Adds logging prefix to newlines to align multi-line messages.
| 16 | |
| 17 | |
| 18 | class NewLineFormatter(logging.Formatter): |
| 19 | """Adds logging prefix to newlines to align multi-line messages.""" |
| 20 | |
| 21 | def __init__(self, fmt, datefmt=None): |
| 22 | logging.Formatter.__init__(self, fmt, datefmt) |
| 23 | |
| 24 | def format(self, record): |
| 25 | msg = logging.Formatter.format(self, record) |
| 26 | if record.message != "": |
| 27 | parts = msg.split(record.message) |
| 28 | msg = msg.replace("\n", "\r\n" + parts[0]) |
| 29 | return msg |
| 30 | |
| 31 | |
| 32 | _root_logger = logging.getLogger("lightllm") |
no outgoing calls
no test coverage detected