summaryrefslogtreecommitdiff
path: root/tracing.py
diff options
context:
space:
mode:
Diffstat (limited to 'tracing.py')
-rw-r--r--tracing.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tracing.py b/tracing.py
index f80ec54..85f1a54 100644
--- a/tracing.py
+++ b/tracing.py
@@ -59,10 +59,12 @@ def trace_clear_patterns():
def trace(msg):
- frames = traceback.extract_stack(limit=2)
- filename, lineno, funcname, text = frames[0]
- for pattern in trace_patterns:
- if pattern in filename:
- logging.debug('%s:%s:%s: %s' % (filename, lineno, funcname, msg))
- break
+ if trace_patterns:
+ frames = traceback.extract_stack(limit=2)
+ filename, lineno, funcname, text = frames[0]
+ for pattern in trace_patterns:
+ if pattern in filename:
+ logging.debug('%s:%s:%s: %s' %
+ (filename, lineno, funcname, msg))
+ break