aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/logger.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/utility/logger.py')
-rw-r--r--wqflask/utility/logger.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/wqflask/utility/logger.py b/wqflask/utility/logger.py
index 6a8b3e7e..d56b134c 100644
--- a/wqflask/utility/logger.py
+++ b/wqflask/utility/logger.py
@@ -29,7 +29,7 @@
import logging
import string
from inspect import isfunction
-from utility.tools import LOG_LEVEL
+from utility.tools import LOG_LEVEL, LOG_SQL
class GNLogger:
"""A logger class with some additional functionality, such as
@@ -76,10 +76,12 @@ class GNLogger:
def sql(self, description, sqlcommand, fun = None):
"""Log SQL command, optionally invoking a timed fun"""
- self.info(description,sqlcommand)
+ if LOG_SQL:
+ self.info(description,sqlcommand)
if fun:
result = fun(sqlcommand)
- self.info("result:",result)
+ if LOG_SQL:
+ self.debug(result)
return result
def collect(self,fun,*args):