JsonLogFormatter#
- class caf.toolkit.log_helpers.JsonLogFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]#
Format log records as one JSON object per line.
Attributes
Methods
__init__([fmt, datefmt, style, validate, ...])Initialize the formatter with specified format strings.
localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
format(record)Format a log record to a JSON string.
formatException(ei)Format and return the specified exception information as a string.
formatMessage(record)formatStack(stack_info)This method is provided as an extension point for specialized formatting of stack information.
formatTime(record[, datefmt])Return the creation time of the specified LogRecord as formatted text.
usesTime()Check if the format uses the creation time of the record.
Attributes Documentation
- default_msec_format = '%s,%03d'#
- default_time_format = '%Y-%m-%d %H:%M:%S'#