# _debug

URL: /kida/api/environment/filters/_debug/
Section: filters
Description: Debug filters for Kida templates.

---

> For a complete page index, fetch /kida/llms.txt.

Open LLM text
(/kida/api/environment/filters/_debug/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Ffilters%2F_debug%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Ffilters%2F_debug%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Ffilters%2F_debug%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Ffilters%2F_debug%2Findex.txt)

Module

#
`environment.filters._debug`

Debug filters for Kida templates.

3Functions

## Functions

`_debug_repr`

2

`str`

▼

Create a compact repr for debug output.

`def _debug_repr(value: Any, max_len: int = 60) -> str`

##### Parameters

Name
Type
Description

`value`
`Any`

`max_len`
`int`

Default:`60`

##### Returns

`str`

`_filter_debug`

3

`Any`

▼

Debug filter that prints variable info to stderr and returns the value unchange…

`def _filter_debug(value: Any, label: str | None = None, max_items: int = 5) -> Any`

Debug filter that prints variable info to stderr and returns the value unchanged.

Usage:
{{ posts | debug }} -> Shows type and length
{{ posts | debug('my posts') }} -> Shows with custom label
{{ posts | debug(max_items=10) }} -> Show more items

Output example:
DEBUG [my posts]: <list[5]>
[0] Page(title='Getting Started', weight=10)
[1] Page(title='Installation', weight=None) <-- None!
...

##### Parameters

Name
Type
Description

`value`
`Any`

The value to inspect

`label`
`str | None`

Optional label for the output

Default:`None`

`max_items`
`int`

Maximum number of items to show for sequences

Default:`5`

##### Returns

`Any`

`_filter_pprint`

1

`str`

▼

Pretty-print a value.

`def _filter_pprint(value: Any) -> str`

##### Parameters

Name
Type
Description

`value`
`Any`

##### Returns

`str`
