Properly identify code location of logging message
authorJohn Dennis <jdennis@redhat.com>
Sat, 10 Oct 2015 15:09:02 +0000 (11:09 -0400)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Sat, 10 Oct 2015 21:23:53 +0000 (23:23 +0200)
commit39783cb020d8a88785ce1de6f516bf2d69300002
tree68ddaa4827614facd6aabe7adf561b880185a857
parentf04fa820d439513de6a2c55bb097c7fde12d6806
Properly identify code location of logging message

The method Log.call_location() is used to add identifying infomation
about the location in the code where a logging message is emitted
from.  It needs to walk up the stack to bypass calls involved in
logging to find where the call to logging was made. Formerly the code
has a hardcoded offset into the list of stack frame objects. But any
change in the logging implementation perturbs that offset. This patch
fixes that problem by walking up the stack until a non-logging
function is identified.

Ticket: 172
Signed-off-by: John Dennis <jdennis@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/util/log.py