Disable sorting in CustomConsoleRenderer (#3711)

This commit is contained in:
Stanislav Novosad
2025-10-14 16:50:41 -06:00
committed by GitHub
parent ff4a2c982b
commit e13e9a5d58
2 changed files with 4 additions and 1 deletions

View File

@@ -100,6 +100,9 @@ class CustomConsoleRenderer(structlog.dev.ConsoleRenderer):
colorize it.
"""
def __init__(self) -> None:
super().__init__(sort_keys=False)
def __call__(self, logger: logging.Logger, name: str, event_dict: EventDict) -> str:
file_section = event_dict.pop("file", "")
file_section_colored = f"\x1b[90m{file_section}\x1b[0m" if file_section else ""