summaryrefslogtreecommitdiffstats
path: root/odl-pipeline/lib/utils/utils_log.py
diff options
context:
space:
mode:
Diffstat (limited to 'odl-pipeline/lib/utils/utils_log.py')
-rwxr-xr-xodl-pipeline/lib/utils/utils_log.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/odl-pipeline/lib/utils/utils_log.py b/odl-pipeline/lib/utils/utils_log.py
index e49434c..9d7648f 100755
--- a/odl-pipeline/lib/utils/utils_log.py
+++ b/odl-pipeline/lib/utils/utils_log.py
@@ -11,6 +11,7 @@ import logging
import datetime
import os
import sys
+import types
LOG = logging.getLogger(__name__)
LOG_LEVEL = logging.DEBUG
@@ -35,7 +36,10 @@ def log_enter_exit(func):
'args': args,
'kwargs': kwargs})
start = datetime.datetime.now()
- ret = func(self, *args, **kwargs)
+ if isinstance(func, types.FunctionType):
+ ret = func(*args, **kwargs)
+ else:
+ ret = func(self, *args, **kwargs)
end = datetime.datetime.now()
LOG.debug(("Exiting %(cls)s.%(method)s. "
"Spent %(duration)s sec. "