| 51 | level_mapping = {"DEBUG": "D", "INFO": "I", "WARNING": "W", "ERROR": "E", "CRITICAL": "C"} |
| 52 | |
| 53 | class CustomFormatter(logging.Formatter): |
| 54 | def format(self, record): |
| 55 | record.levelname = level_mapping.get(record.levelname, record.levelname) |
| 56 | return super().format(record) |
| 57 | |
| 58 | formatter = CustomFormatter( |
| 59 | fmt="%(asctime)s.%(msecs)03d [%(levelname)s] %(message)-80s (%(process)d:%(filename)s:%(lineno)s)", |