diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-02-03 20:26:37 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-02-03 20:26:37 +0000 |
commit | 67aca5f5bc86673a59ccbadc5ec3c3e4984b52a0 (patch) | |
tree | e732c2e86f7a33e5e0e724c2d3ce8079bb93363f /tracing.py | |
parent | 1eef521147d2564d66519a832a7736d41cb74a88 (diff) | |
download | python-tracing-67aca5f5bc86673a59ccbadc5ec3c3e4984b52a0.tar.gz |
Only log basename.
Diffstat (limited to 'tracing.py')
-rw-r--r-- | tracing.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -44,6 +44,7 @@ substring checking only, no globbing or regexps, sorry. import logging +import os import traceback @@ -62,6 +63,7 @@ def trace(msg): if trace_patterns: frames = traceback.extract_stack(limit=2) filename, lineno, funcname, text = frames[0] + filename = os.path.basename(filename) for pattern in trace_patterns: if pattern in filename: logging.debug('%s:%s:%s: %s' % |