From a0f3da4c4c0002a511abff67a048acf2e21ed5d6 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sat, 17 Sep 2022 21:38:14 -0700 Subject: [PATCH] update debugging to add timestamps for making query times easier.. --- ui/medashare/cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/medashare/cli.py b/ui/medashare/cli.py index b6e1595..f27f4a1 100644 --- a/ui/medashare/cli.py +++ b/ui/medashare/cli.py @@ -9,11 +9,14 @@ _real_stderr = sys.stderr _sql_verbose = False if False: + lvl = logging.DEBUG + lvl = logging.INFO _handler = logging.StreamHandler(_real_stderr) - _handler.setLevel(logging.DEBUG) + _handler.setLevel(lvl) + _handler.setFormatter(logging.Formatter('%(asctime)s: %(message)s')) import sqlalchemy logging.getLogger('sqlalchemy').addHandler(_handler) - logging.getLogger('sqlalchemy.engine').setLevel(logging.DEBUG) + logging.getLogger('sqlalchemy.engine').setLevel(lvl) def _debprint(*args): # pragma: no cover import traceback, sys, os.path