raito.utils.loggers module

class raito.utils.loggers.ColoredFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

property terminal_width: int
format(record)[source]

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.

Parameters:

record (LogRecord)

Return type:

str

get_meta(record)[source]
Parameters:

record (LogRecord)

Return type:

str

get_message(record, levelname)[source]
Parameters:
  • record (LogRecord)

  • levelname (Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'])

Return type:

str

class raito.utils.loggers.MuteLoggersFilter(*names)[source]

Bases: Filter

Parameters:

names (str)

filter(record)[source]

Determine if the specified record is to be logged.

Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.

Parameters:

record (LogRecord)

Return type:

bool