From 236a8ffc5976942b4274d01fee669746c1a043f9 Mon Sep 17 00:00:00 2001 From: MJ Rossetti Date: Sun, 13 Oct 2024 20:54:09 -0400 Subject: [PATCH] Set log level more directly --- truthbrush/api.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/truthbrush/api.py b/truthbrush/api.py index 3652bb1..1e4dcdd 100644 --- a/truthbrush/api.py +++ b/truthbrush/api.py @@ -12,13 +12,9 @@ load_dotenv() # take environment variables from .env. -logging.basicConfig( - level=( - logging.DEBUG - if os.getenv("DEBUG") and os.getenv("DEBUG").lower() != "false" - else logging.INFO - ) -) +# LOG_LEVEL: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET +LOG_LEVEL = os.getenv("LOG_LEVEL", default="INFO").upper() +logging.basicConfig(level=eval("logging.{LOG_LEVEL}")), BASE_URL = "https://truthsocial.com" API_BASE_URL = "https://truthsocial.com/api"