Commit 9afa3f93 authored by Benjamin Peterson's avatar Benjamin Peterson

merge heads

parents de94a556 6b1ba7f4
...@@ -879,16 +879,27 @@ class Handler(Filterer): ...@@ -879,16 +879,27 @@ class Handler(Filterer):
The record which was being processed is passed in to this method. The record which was being processed is passed in to this method.
""" """
if raiseExceptions and sys.stderr: # see issue 13807 if raiseExceptions and sys.stderr: # see issue 13807
ei = sys.exc_info() t, v, tb = sys.exc_info()
try: try:
traceback.print_exception(ei[0], ei[1], ei[2], sys.stderr.write('--- Logging error ---\n')
None, sys.stderr) traceback.print_exception(t, v, tb, None, sys.stderr)
sys.stderr.write('Logged from file %s, line %s\n' % ( sys.stderr.write('Call stack:\n')
record.filename, record.lineno)) # Walk the stack frame up until we're out of logging,
# so as to print the calling context.
frame = tb.tb_frame
while (frame and os.path.dirname(frame.f_code.co_filename) ==
__path__[0]):
frame = frame.f_back
if frame:
traceback.print_stack(frame, file=sys.stderr)
else:
# couldn't find the right stack frame, for some reason
sys.stderr.write('Logged from file %s, line %s\n' % (
record.filename, record.lineno))
except IOError: #pragma: no cover except IOError: #pragma: no cover
pass # see issue 5971 pass # see issue 5971
finally: finally:
del ei del t, v, tb
class StreamHandler(Handler): class StreamHandler(Handler):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment