File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 5
5
import sys
6
6
import os
7
7
8
+ VLLM_CONFIGURE_LOGGING = int (os .getenv ("VLLM_CONFIGURE_LOGGING" , "1" ))
9
+
8
10
_FORMAT = "%(levelname)s %(asctime)s %(filename)s:%(lineno)d] %(message)s"
9
11
_DATE_FORMAT = "%m-%d %H:%M:%S"
10
12
@@ -45,13 +47,15 @@ def _setup_logger():
45
47
# The logger is initialized when the module is imported.
46
48
# This is thread-safe as the module is only imported once,
47
49
# guaranteed by the Python GIL.
48
- _setup_logger ()
50
+ if VLLM_CONFIGURE_LOGGING :
51
+ _setup_logger ()
49
52
50
53
51
54
def init_logger (name : str ):
52
55
# Use the same settings as above for root logger
53
56
logger = logging .getLogger (name )
54
57
logger .setLevel (os .getenv ("LOG_LEVEL" , "DEBUG" ))
55
- logger .addHandler (_default_handler )
56
- logger .propagate = False
58
+ if VLLM_CONFIGURE_LOGGING :
59
+ logger .addHandler (_default_handler )
60
+ logger .propagate = False
57
61
return logger
You can’t perform that action at this time.
0 commit comments