(color)
| 5 | |
| 6 | |
| 7 | def build_format(color): |
| 8 | reset = "\x1b[0m" |
| 9 | underline = "\x1b[3m" |
| 10 | return ( |
| 11 | f"{color}[%(asctime)s] %(levelname)s:{reset} %(message)s " |
| 12 | + f"{underline}(%(filename)s:%(lineno)d:%(name)s){reset}" |
| 13 | ) |
| 14 | |
| 15 | |
| 16 | class CustomFormatter(logging.Formatter): |