diff options
author | Pjotr Prins | 2016-06-21 08:59:26 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-06-21 08:59:26 +0000 |
commit | aa638a88e843657bb80f1db1e726b6135cefd11f (patch) | |
tree | de3e838a3ea33a646823a96726edc1bb4bac66fb /wqflask/utility/logger.py | |
parent | 2bae8718f4d4ec185586d12ae007f79a8dd89136 (diff) | |
download | genenetwork2-aa638a88e843657bb80f1db1e726b6135cefd11f.tar.gz |
Logger: SQL
Diffstat (limited to 'wqflask/utility/logger.py')
-rw-r--r-- | wqflask/utility/logger.py | 8 |
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): |