From fae8edb043c9f209ecda5b0cb2b3aab349816d19 Mon Sep 17 00:00:00 2001 From: nex Date: Fri, 23 Feb 2024 23:16:49 +0000 Subject: [PATCH] allow disabling logging silencing --- server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index b8444a5..a2d5961 100644 --- a/server.py +++ b/server.py @@ -44,9 +44,10 @@ logging.basicConfig( format="%(asctime)s:%(levelname)s:%(name)s:%(message)s", datefmt="%d/%m/%Y %H:%M:%S" ) -logging.getLogger("httpcore.connection").setLevel(logging.INFO) -logging.getLogger("httpcore.http11").setLevel(logging.INFO) -logging.getLogger("httpx").setLevel(logging.INFO) +if os.getenv("LOG_DEBUG_TIDY") != "1": + logging.getLogger("httpcore.connection").setLevel(logging.INFO) + logging.getLogger("httpcore.http11").setLevel(logging.INFO) + logging.getLogger("httpx").setLevel(logging.INFO) app = fastapi.FastAPI( root_path=os.environ.get("PREVIEW_ROOT_PATH", ""), lifespan=startup