impuls.tools.logs

impuls.tools.logs.initialize()

See impuls.initialize_logging.

class impuls.tools.logs.ColoredFormatter

Bases: Formatter

ColoredFormatter is an opinionated log formatter with human-readable output colored with ANSI escape sequences.

format(record: LogRecord) str

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

static get_msg_color(level: int) str
usesTime() bool

Check if the format uses the creation time of the record.

default_msec_format = '%s.%03d'
default_time_format = '%H:%M:%S'