[Core][Logging] Add built-in JSON formatter (#58739)
Add `--logging-config.formatter=json` to enable the python-json-logger formatter without having to use a complete Python logging dictConfig. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Co-authored-by: OpenAI Codex <noreply@openai.com>
This commit is contained in:
co-authored by
OpenAI Codex
parent
c4fc3c7d32
commit
91fcec1235
@@ -4,6 +4,10 @@
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
JSON_FORMAT = (
|
||||
"%(asctime)s %(levelname)s %(name)s %(processName)s %(process)d %(message)s"
|
||||
)
|
||||
|
||||
|
||||
class NewLineFormatter(logging.Formatter):
|
||||
"""Adds logging prefix to newlines to align multi-line messages."""
|
||||
|
||||
Reference in New Issue
Block a user