qualia_core.utils.logger.ConsoleFormatter module

class qualia_core.utils.logger.ConsoleFormatter.ConsoleColors[source]

Bases: object

CYAN = '\x1b[36m'
BLUE = '\x1b[34m'
YELLOW = '\x1b[33m'
RED = '\x1b[31m'
BROWN = '\x1b[31;1m'
RESET = '\x1b[0m'
class qualia_core.utils.logger.ConsoleFormatter.ConsoleFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: 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.

FORMATS: Final[dict[int, str]] = {10: '\x1b[36m', 20: '\x1b[0m', 30: '\x1b[33m', 40: '\x1b[31m', 50: '\x1b[31;1m'}
format(record: LogRecord) str[source]