Spaces:
Build error
Build error
nileshhanotia
commited on
Update utils/logger.py
Browse files- utils/logger.py +5 -2
utils/logger.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
import logging
|
2 |
-
|
3 |
|
4 |
def setup_logger(name):
|
|
|
|
|
|
|
5 |
logger = logging.getLogger(name)
|
6 |
-
logger.setLevel(
|
7 |
|
8 |
if not logger.handlers:
|
9 |
handler = logging.StreamHandler()
|
|
|
1 |
import logging
|
2 |
+
import os
|
3 |
|
4 |
def setup_logger(name):
|
5 |
+
# Get log level from environment or default to INFO
|
6 |
+
log_level = os.getenv('LOG_LEVEL', 'INFO')
|
7 |
+
|
8 |
logger = logging.getLogger(name)
|
9 |
+
logger.setLevel(log_level)
|
10 |
|
11 |
if not logger.handlers:
|
12 |
handler = logging.StreamHandler()
|