utils¶
Log utils
Logging utilities.
msgspec_json_renderer()
- A JSON Renderer for structlog using msgspec.
Msgspec doesn’t have an API consistent with the stdlib’s json
module,
which is required for Structlog's JSONRenderer
.
EventFilter
- A structlog processor that removes keys from the log event if they exist.
- class src.server.lib.log.utils.EventFilter(filter_keys: Iterable[str])[source]
Bases:
object
Remove keys from the log event.
Add an instance to the processor chain.
Example: # noqa
structlog.configure( ..., processors=[ ..., EventFilter(["color_message"]), ..., ], )
Initialize the processor.
- Parameters:
filter_keys – Iterable of string keys to be excluded from the log event.
- Returns:
None