class timeflux.core.logging.UTCFormatterConsole(fmt=None, datefmt=None, style=DEFAULT_FORMAT_STYLE, level_styles=None, field_styles=None)[source]

Bases: coloredlogs.ColoredFormatter

Initialize a ColoredFormatter object.

  • fmt – A log format string (defaults to DEFAULT_LOG_FORMAT).

  • datefmt – A date/time format string (defaults to None, but see the documentation of BasicFormatter.formatTime()).

  • style – One of the characters %, { or $ (defaults to DEFAULT_FORMAT_STYLE)

  • level_styles – A dictionary with custom level styles (defaults to DEFAULT_LEVEL_STYLES).

  • field_styles – A dictionary with custom field styles (defaults to DEFAULT_FIELD_STYLES).


Refer to check_style().

This initializer uses colorize_format() to inject ANSI escape sequences in the log format string before it is passed to the initializer of the base class.

class timeflux.core.logging.UTCFormatterFile(fmt=None, datefmt=None, style='%', validate=True)[source]

Bases: logging.Formatter

Initialize the formatter with specified format strings.

Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.

Use a style parameter of ‘%’, ‘{‘ or ‘$’ to specify that you want to use one of %-formatting, str.format() ({}) formatting or string.Template formatting in your format string.

Changed in version 3.2: Added the style parameter.

class timeflux.core.logging.Handler[source]
handle(self, record)[source]
timeflux.core.logging.init_listener(level_console='INFO', level_file='DEBUG', file=None)[source]