(self, console: Console | None = None, emoji: str = "")
| 17 | """Custom formatter that uses Rich for colorized output.""" |
| 18 | |
| 19 | def __init__(self, console: Console | None = None, emoji: str = ""): |
| 20 | super().__init__() |
| 21 | self.console = console or Console() |
| 22 | self.emoji = emoji + " " if emoji and not emoji.endswith(" ") else emoji |
| 23 | self.level_colors = { |
| 24 | logging.DEBUG: "dim cyan", |
| 25 | logging.INFO: "green", |
| 26 | logging.WARNING: "yellow", |
| 27 | logging.ERROR: "red", |
| 28 | logging.CRITICAL: "bold red", |
| 29 | } |
| 30 | |
| 31 | def format(self, record: logging.LogRecord) -> str: |
| 32 | level_color = self.level_colors.get(record.levelno, "white") |
nothing calls this directly
no outgoing calls
no test coverage detected