summaryrefslogtreecommitdiffstats
path: root/ipsilon/util/plugin.py
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2015-01-12 10:47:37 -0500
committerJohn Dennis <jdennis@redhat.com>2015-01-21 14:04:12 -0500
commit00d5e9272667605c6b5bb83746dcdea54bfa3977 (patch)
tree7ca53f27e44983d704b5af64335c38f7ca4c0e31 /ipsilon/util/plugin.py
parent45cb73a21a90084818c3057e362ef9459f1600f3 (diff)
downloadipsilon-log_location.tar.gz
ipsilon-log_location.tar.xz
ipsilon-log_location.zip
Add source code context information to debug log messageslog_location
The log.debug() function helpfully adds the name of the function invoking it but in a complicated software package there are many functions/methods which share the same name. Thus a debug message lke this: DEBUG(__init__): xxx does not give you much context, there are probably hundreds of __init__ methods. It would help to qualify the method name which it's class name, that gives a lot more context when reading the log. Sometimes it's also helpful to know the file and line number. This patch adds the class name to the function and included the filename and line number as well. The file path is trimmed to the last 3 components, sufficient to give context but not too verbose. Now the debug message might look like this instead: DEBUG(ipsilon/providers/common.py:129 LoadProviders.__init__()): xxx Also included is a config option 'stacktrace_on_error' which will include a stacktrace when the log.error function is called. It can be very useful to see a stacktrace when logging an error, it defaults to off. Signed-off-by: John Dennis <jdennis@redhat.com>
Diffstat (limited to 'ipsilon/util/plugin.py')
0 files changed, 0 insertions, 0 deletions