nileshhanotia commited on
Commit
b144f8e
·
verified ·
1 Parent(s): 2008715

Update utils/logger.py

Browse files
Files changed (1) hide show
  1. utils/logger.py +5 -2
utils/logger.py CHANGED
@@ -1,9 +1,12 @@
1
  import logging
2
- from config.settings import LOG_LEVEL
3
 
4
  def setup_logger(name):
 
 
 
5
  logger = logging.getLogger(name)
6
- logger.setLevel(LOG_LEVEL)
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()