Super tiny allow millisecond precision in logging (#14183)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user