Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
312c95f8
Commit
312c95f8
authored
Oct 31, 2012
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
d9c8702c
d06d5403
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
Lib/logging/__init__.py
Lib/logging/__init__.py
+17
-6
No files found.
Lib/logging/__init__.py
View file @
312c95f8
...
...
@@ -879,16 +879,27 @@ class Handler(Filterer):
The record which was being processed is passed in to this method.
"""
if
raiseExceptions
and
sys
.
stderr
:
# see issue 13807
ei
=
sys
.
exc_info
()
t
,
v
,
tb
=
sys
.
exc_info
()
try
:
traceback
.
print_exception
(
ei
[
0
],
ei
[
1
],
ei
[
2
],
None
,
sys
.
stderr
)
sys
.
stderr
.
write
(
'Logged from file %s, line %s
\
n
'
%
(
record
.
filename
,
record
.
lineno
))
sys
.
stderr
.
write
(
'--- Logging error ---
\
n
'
)
traceback
.
print_exception
(
t
,
v
,
tb
,
None
,
sys
.
stderr
)
sys
.
stderr
.
write
(
'Call stack:
\
n
'
)
# 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
pass
# see issue 5971
finally
:
del
ei
del
t
,
v
,
tb
class
StreamHandler
(
Handler
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment