format.
(self, record: LogRecord)
| 70 | _RESET_COLOR = '\033[0m' |
| 71 | |
| 72 | def format(self, record: LogRecord): |
| 73 | """format.""" |
| 74 | if not can_colorize(): |
| 75 | # windows does not support ASNI color |
| 76 | return super().format(record) |
| 77 | levelname = record.levelname |
| 78 | level_color = self._LEVELNAME_COLOR_MAP.get(levelname, self._RESET_COLOR) |
| 79 | levelname = f'{level_color}{levelname}{self._RESET_COLOR}' |
| 80 | record.levelname = levelname |
| 81 | return super().format(record) |
| 82 | |
| 83 | |
| 84 | class FilterDuplicateWarning(logging.Filter): |
no test coverage detected