diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-02-03 20:02:44 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-02-03 20:02:44 +0000 |
commit | 1eef521147d2564d66519a832a7736d41cb74a88 (patch) | |
tree | a262deced260af7fd30d8d479e65f0d4e8164c4e | |
parent | bb2185cda758c4060c805971f5e5a7bff596da53 (diff) | |
download | python-tracing-1eef521147d2564d66519a832a7736d41cb74a88.tar.gz |
Speed optimization. Don't dig out tracebacks if there are no patterns.
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tracing.py | 14 |
3 files changed, 15 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog index 1b2f3a5..5c1b022 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-tracing (0.1) squeeze; urgency=low + + * Speed optimization. Don't dig out tracebacks if there are no patterns. + + -- Lars Wirzenius <liw@liw.fi> Thu, 03 Feb 2011 20:01:20 +0000 + python-tracing (0.0) squeeze; urgency=low * Initial packaging. This is not intended to be uploaded to Debian, so @@ -18,7 +18,7 @@ from distutils.core import setup, Extension setup(name='tracing', - version='0.0', + version='0.1', description='debug log/trace messages', author='Lars Wirzenius', author_email='liw@liw.fi', @@ -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 |