From 20017a95ac6a5b4bdde35e4f6e48da6b2ea76d2a Mon Sep 17 00:00:00 2001 From: Thephaseless Date: Fri, 13 Sep 2024 18:03:38 +0000 Subject: [PATCH] fix deprecation --- main.py | 3 ++- src/utils/consts.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index c7eaf5c..847fc06 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ from __future__ import annotations import asyncio +import logging import time import uvicorn @@ -13,7 +14,7 @@ from src.utils import logger from src.utils.browser import bypass_cloudflare, new_browser from src.utils.consts import LOG_LEVEL -app = FastAPI(debug=True) +app = FastAPI(debug=LOG_LEVEL == logging.DEBUG, log_level=LOG_LEVEL) @app.get("/") diff --git a/src/utils/consts.py b/src/utils/consts.py index 0463ff9..2d9cf23 100644 --- a/src/utils/consts.py +++ b/src/utils/consts.py @@ -3,7 +3,7 @@ import os from pathlib import Path LOG_LEVEL = os.getenv("LOG_LEVEL") or "INFO" -LOG_LEVEL = logging.getLevelName(LOG_LEVEL.upper()) +LOG_LEVEL = logging.getLevelNamesMapping()[LOG_LEVEL.upper()] CHALLENGE_TITLES = [ # Cloudflare