Modif log (vers console) en mode debug

This commit is contained in:
Emmanuel Viennet 2022-09-07 13:06:26 +02:00
parent 426865c9c5
commit 59649b713d
1 changed files with 2 additions and 2 deletions

View File

@ -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()