diff --git a/devstack/log.py b/devstack/log.py index c70249a1..0d989532 100644 --- a/devstack/log.py +++ b/devstack/log.py @@ -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