toolr.utils._logs¶
ExtraFormatter ¶
Bases: Formatter
Custom formatter that appends a JSON with the extra parameters to the output of the default formatter.
Inspired on JsonFormatter.merge_record_extra https://github.com/nhairs/python-json-logger/blob/v3.3.0/src/pythonjsonlogger/core.py#L100-L124
DuplicateTimesFormatter ¶
Bases: ExtraFormatter
Formatter that adds a timestamp to the message, if it's not a duplicate.
Source code in python/toolr/utils/_logs.py
include_timestamps ¶
include_timestamps() -> bool
Return True if any of the configured logging handlers includes timestamps.
setup_logging ¶
setup_logging(
verbosity: ConsoleVerbosity, timestamps: bool = False
) -> None
Setup logging level and logging handler formatter.