(self, colorize: bool)
| 35 | |
| 36 | class MitmFormatter(logging.Formatter): |
| 37 | def __init__(self, colorize: bool): |
| 38 | super().__init__() |
| 39 | self.colorize = colorize |
| 40 | time = "[%s]" |
| 41 | client = "[%s]" |
| 42 | if colorize: |
| 43 | time = miniclick.style(time, fg="cyan", dim=True) |
| 44 | client = miniclick.style(client, fg="yellow", dim=True) |
| 45 | |
| 46 | self.with_client = f"{time}{client} %s" |
| 47 | self.without_client = f"{time} %s" |
| 48 | |
| 49 | default_time_format = "%H:%M:%S" |
| 50 | default_msec_format = "%s.%03d" |