| 33 | level_mapping = {"DEBUG": "D", "INFO": "I", "WARNING": "W", "ERROR": "E", "CRITICAL": "C"} |
| 34 | |
| 35 | class CustomFormatter(logging.Formatter): |
| 36 | def format(self, record): |
| 37 | record.levelname = level_mapping.get(record.levelname, record.levelname) |
| 38 | return super().format(record) |
| 39 | |
| 40 | formatter = CustomFormatter( |
| 41 | fmt="%(asctime)s.%(msecs)03d [%(levelname)s] %(message)-80s (%(process)d:%(filename)s:%(lineno)s)", |