From 59649b713d65f18068788e466f5512908cd8a52a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 7 Sep 2022 13:06:26 +0200 Subject: [PATCH] Modif log (vers console) en mode debug --- app/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index aafade123..962cc5423 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -486,12 +486,12 @@ def log(msg: str, silent_test=True): # Flask Working outside of application context. pass - if current_app: + if current_app and not current_app.config["DEBUG"]: current_app.logger.info(msg) else: sys.stdout.flush() sys.stderr.write( - "[%s] scodoc: %s\n" % (time.strftime("%a %b %d %H:%M:%S %Y"), msg) + f"""[{time.strftime("%a %b %d %H:%M:%S %Y")}] scodoc: {msg}\n""" ) sys.stderr.flush()