[UX] Suppress noisy httpx/httpcore INFO logs (#20944)
This commit is contained in:
committed by
GitHub
parent
319bb4974c
commit
29ced9c162
@@ -6,6 +6,9 @@ import os
|
||||
|
||||
from sglang.cli.utils import get_is_diffusion_model, get_model_path
|
||||
from sglang.srt.utils import kill_process_tree
|
||||
from sglang.srt.utils.common import suppress_noisy_warnings
|
||||
|
||||
suppress_noisy_warnings()
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1022,6 +1022,11 @@ def suppress_noisy_warnings():
|
||||
category=FutureWarning,
|
||||
)
|
||||
|
||||
# Suppress noisy third-party HTTP loggers.
|
||||
# huggingface_hub uses httpx which logs every HTTP request at INFO level.
|
||||
for name in ("httpx", "httpcore"):
|
||||
logging.getLogger(name).setLevel(logging.WARNING)
|
||||
|
||||
|
||||
def suppress_other_loggers():
|
||||
suppress_noisy_warnings()
|
||||
@@ -1181,6 +1186,12 @@ def configure_logger(server_args, prefix: str = ""):
|
||||
force=True,
|
||||
)
|
||||
|
||||
# Suppress noisy httpx/httpcore loggers in every process that calls
|
||||
# configure_logger (main, scheduler, detokenizer). Spawned subprocesses
|
||||
# don't inherit the parent's logger state, so this must run here too.
|
||||
for name in ("httpx", "httpcore"):
|
||||
logging.getLogger(name).setLevel(logging.WARNING)
|
||||
|
||||
|
||||
# source: https://github.com/vllm-project/vllm/blob/93b38bea5dd03e1b140ca997dfaadef86f8f1855/vllm/lora/utils.py#L9
|
||||
def replace_submodule(
|
||||
|
||||
Reference in New Issue
Block a user