Skip to content

Commit

Permalink
Set local logging level via env variable (vllm-project#2774)
Browse files Browse the repository at this point in the history
  • Loading branch information
gardberg authored and jimpang committed Feb 22, 2024
1 parent 4a8ccf4 commit a62ec2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vllm/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Logging configuration for vLLM."""
import logging
import sys
import os

_FORMAT = "%(levelname)s %(asctime)s %(filename)s:%(lineno)d] %(message)s"
_DATE_FORMAT = "%m-%d %H:%M:%S"
Expand Down Expand Up @@ -50,7 +51,7 @@ def _setup_logger():
def init_logger(name: str):
# Use the same settings as above for root logger
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
logger.setLevel(os.getenv("LOG_LEVEL", "DEBUG"))
logger.addHandler(_default_handler)
logger.propagate = False
return logger

0 comments on commit a62ec2d

Please sign in to comment.