Updated so that the debug functor only attempts its job if logging debug is on.
This commit is contained in:
parent
4f1a8c547f
commit
0b249a6283
@ -58,9 +58,11 @@ SysLogHandler = SysLogHandler
|
||||
def log_debug(f):
|
||||
@functools.wraps(f)
|
||||
def wrapper(*args, **kw):
|
||||
logging.debug('%s(%s, %s) ->', f.func_name, str(args), str(kw))
|
||||
if root.isEnabledFor(debug):
|
||||
logging.debug('%s(%s, %s) ->', f.func_name, str(args), str(kw))
|
||||
rv = f(*args, **kw)
|
||||
logging.debug(pprint.pformat(rv, indent=2))
|
||||
logging.debug('')
|
||||
if root.isEnabledFor(debug):
|
||||
logging.debug(pprint.pformat(rv, indent=2))
|
||||
logging.debug('')
|
||||
return rv
|
||||
return wrapper
|
||||
|
Loading…
Reference in New Issue
Block a user