Super tiny allow millisecond precision in logging (#14183)

This commit is contained in:
fzyzcjy
2025-12-01 14:46:09 +08:00
committed by GitHub
parent 487c8d4df3
commit a2960bdd6b
2 changed files with 3 additions and 2 deletions

View File

@@ -145,6 +145,7 @@ class Envs:
# Logging Options
SGLANG_LOG_GC = EnvBool(False)
SGLANG_LOG_FORWARD_ITERS = EnvBool(False)
SGLANG_LOG_MS = EnvBool(False)
SGLANG_DISABLE_REQUEST_LOGGING = EnvBool(False)
# Test & Debug

View File

@@ -1203,8 +1203,8 @@ def configure_logger(server_args, prefix: str = ""):
custom_config = orjson.loads(file.read())
logging.config.dictConfig(custom_config)
return
format = f"[%(asctime)s{prefix}] %(message)s"
# format = f"[%(asctime)s.%(msecs)03d{prefix}] %(message)s"
maybe_ms = ".%(msecs)03d" if envs.SGLANG_LOG_MS.get() else ""
format = f"[%(asctime)s{maybe_ms}{prefix}] %(message)s"
logging.basicConfig(
level=getattr(logging, server_args.log_level.upper()),
format=format,