raito.utils.loggers module

class raito.utils.loggers.ColoredFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[исходный код]

Базовые классы: Formatter

property terminal_width: int
format(record)[исходный код]

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.

Параметры:

record (LogRecord)

Тип результата:

str

get_meta(record)[исходный код]
Параметры:

record (LogRecord)

Тип результата:

str

get_message(record, levelname)[исходный код]
Параметры:
  • record (LogRecord)

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

Тип результата:

str

class raito.utils.loggers.MuteLoggersFilter(*names)[исходный код]

Базовые классы: Filter

Параметры:

names (str)

filter(record)[исходный код]

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.

Параметры:

record (LogRecord)

Тип результата:

bool