Skip to content

Commit f4f27af

Browse files
committed
misc: small fix or general refactoring i did not bother commenting
1 parent d25914f commit f4f27af

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nerve/runtime/logging.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
from nerve.runtime.events import Event
1010

1111

12+
def _log_message_format(record: dict[str, t.Any]) -> str:
13+
return "{time} <level>{message}</level>\n"
14+
15+
1216
def init(log_path: pathlib.Path | None = None, level: str = "INFO", litellm_debug: bool = False) -> None:
1317
"""
1418
Initialize the logging system.
@@ -18,14 +22,13 @@ def init(log_path: pathlib.Path | None = None, level: str = "INFO", litellm_debu
1822
level: The log level to use.
1923
litellm_debug: Whether to enable litellm debug logging.
2024
"""
21-
format = "{time} {message}"
2225

2326
if level != "DEBUG":
2427
logger.remove()
2528
logger.add(
2629
sys.stdout,
2730
colorize=True,
28-
format=format,
31+
format=_log_message_format,
2932
level=level,
3033
)
3134

0 commit comments

Comments
 (0)