aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/logger.py
diff options
context:
space:
mode:
authorPjotr Prins2016-06-23 09:54:16 +0000
committerPjotr Prins2016-06-23 09:54:16 +0000
commit0a6c114a20d2b02476949511773ad32e591d7d80 (patch)
tree28d523c85ef2a05a1389edd14bfd5404cc00baca /wqflask/utility/logger.py
parentf4200d002cce2edddddac67c55a75c2f1883ea2f (diff)
downloadgenenetwork2-0a6c114a20d2b02476949511773ad32e591d7d80.tar.gz
Logger: improved logging
Diffstat (limited to 'wqflask/utility/logger.py')
-rw-r--r--wqflask/utility/logger.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/wqflask/utility/logger.py b/wqflask/utility/logger.py
index a2ae1f1a..ff53977e 100644
--- a/wqflask/utility/logger.py
+++ b/wqflask/utility/logger.py
@@ -30,10 +30,10 @@ import logging
import string
from inspect import isfunction
from pprint import pformat as pf
+from inspect import stack
from utility.tools import LOG_LEVEL, LOG_SQL, LOG_FORMAT
-
class GNLogger:
"""A logger class with some additional functionality, such as
multiple parameter logging, SQL logging, timing, colors, and lazy
@@ -89,9 +89,9 @@ class GNLogger:
def collect(self,fun,*args):
"""Collect arguments and use fun to output"""
- out = ""
+ out = "."+stack()[2][3]
for a in args:
- if len(out)>0:
+ if len(out)>1:
out += ": "
if isinstance(a, str):
out = out + a
@@ -101,9 +101,9 @@ class GNLogger:
def collectf(self,fun,*args):
"""Collect arguments and use fun to output one by one"""
- out = ""
+ out = "."+stack()[2][3]
for a in args:
- if len(out)>0:
+ if len(out)>1:
out += ": "
if isfunction(a):
out += a()