femto.logger module¶
- class CustomConsoleFormatter(fmt=None, datefmt=None, style='%', validate=True)¶
Bases:
Formatter- RESET = '\x1b[0m'¶
- BOLD = '\x1b[1m'¶
- DIM = '\x1b[2m'¶
- ITALIC = '\x1b[3m'¶
- REVERSE = '\x1b[7m'¶
- FG_WHITE = '\x1b[38;2;236;239;244m'¶
- FG_GRAY = '\x1b[38;2;160;170;180m'¶
- FG_BLUE = '\x1b[38;2;136;192;208m'¶
- FG_GREEN = '\x1b[38;2;163;190;140m'¶
- FG_YELLOW = '\x1b[38;2;235;203;139m'¶
- FG_RED = '\x1b[38;2;191;97;106m'¶
- FG_PURPLE = '\x1b[38;2;180;142;173m'¶
- LEVEL_STYLES = {10: '\x1b[38;2;160;170;180m', 20: '\x1b[38;2;163;190;140m', 30: '\x1b[38;2;235;203;139m', 40: '\x1b[38;2;191;97;106m', 50: '\x1b[1m\x1b[7m\x1b[38;2;191;97;106m'}¶
- 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.
- Return type:
str