(self, record: logging.LogRecord)
| 70 | """Encode record dict as JSON (str).""" |
| 71 | |
| 72 | def format(self, record: logging.LogRecord) -> str: |
| 73 | super().format(record) |
| 74 | # filter out message template and potentially unserializable args |
| 75 | rec = record.__dict__.copy() |
| 76 | del rec['args'] |
| 77 | del rec['msg'] |
| 78 | return orjson.dumps(rec).decode('utf-8') |
| 79 | |
| 80 | |
| 81 | class BinaryFormatter(logging.Formatter): |
no test coverage detected