diff options
-rw-r--r-- | src/python/lmi/providers/cmpi_logging.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/python/lmi/providers/cmpi_logging.py b/src/python/lmi/providers/cmpi_logging.py index 4fc5df2..dca9ac8 100644 --- a/src/python/lmi/providers/cmpi_logging.py +++ b/src/python/lmi/providers/cmpi_logging.py @@ -236,7 +236,7 @@ def _trace_function_or_method(is_method=False, frame_level=1): """ logger = logging.getLogger(__name__+'.trace_function_or_method') logargs = {} - if logger.isEnabledFor(logging.DEBUG): + if logger.isEnabledFor(TRACE_VERBOSE): frm = inspect.currentframe() logargs.update({ "caller_file" : os.path.basename(os.path.splitext( @@ -257,20 +257,21 @@ def _trace_function_or_method(is_method=False, frame_level=1): logargs["args"] = "" else: logargs["args"] = " with args=(%s)" % logargs["args"] - logger.debug("%(caller_file)s:%(caller_lineno)d - %(action)s" - " %(module)s:%(func)s:%(lineno)d%(args)s" , logargs) + logger.trace_verbose("%(caller_file)s:%(caller_lineno)d - " + "%(action)s %(module)s:%(func)s:%(lineno)d%(args)s", + logargs) try: result = func(*args, **kwargs) - if logger.isEnabledFor(logging.DEBUG): + if logger.isEnabledFor(TRACE_VERBOSE): logargs["action"] = "exiting" - logger.debug("%(caller_file)s:%(caller_lineno)d" + logger.trace_verbose("%(caller_file)s:%(caller_lineno)d" " - %(action)s %(module)s:%(func)s:%(lineno)d", logargs) except Exception as exc: - if logger.isEnabledFor(logging.DEBUG): + if logger.isEnabledFor(TRACE_VERBOSE): logargs['action'] = 'exiting' logargs['error'] = str(exc) - logger.debug("%(caller_file)s:%(caller_lineno)d" + logger.trace_verbose("%(caller_file)s:%(caller_lineno)d" " - %(action)s %(module)s:%(func)s:%(lineno)d" " with error: %(error)s", logargs) raise |