Skip to content

Commit cc7354e

Browse files
committed
fix logging in config
1 parent 8ea6668 commit cc7354e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ def _get_required_env_var(key: str) -> str:
4545
@staticmethod
4646
def _parse_log_level(log_level_name: str) -> int:
4747
log_levels = {
48-
"debug": logging.DEBUG,
49-
"info": logging.INFO,
50-
"warning": logging.WARNING,
51-
"error": logging.ERROR,
52-
"critical": logging.CRITICAL,
48+
"DEBUG": logging.DEBUG,
49+
"INFO": logging.INFO,
50+
"WARNING": logging.WARNING,
51+
"ERROR": logging.ERROR,
52+
"CRITICAL": logging.CRITICAL,
5353
}
5454
if log_level_name not in log_levels:
5555
raise ValueError(
@@ -125,10 +125,10 @@ def load() -> "Config":
125125
get = Config._get_required_env_var
126126

127127
# Initialize logger
128-
log_level = Config._parse_log_level(get("LOG_LEVEL").lower())
129-
logging.basicConfig(level=log_level)
128+
log_level = get("LOG_LEVEL").upper()
129+
logging.basicConfig(level=Config._parse_log_level(log_level))
130130
logger = logging.getLogger(__name__)
131-
logger.debug("Logging initialized at level: %s", log_level.upper())
131+
logger.debug("Logging initialized at level: %s", log_level)
132132

133133
# Initialize db
134134
db_type = get("DB_TYPE")

0 commit comments

Comments
 (0)