mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-23 05:35:49 +00:00
do not catch log system exceptions
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1910 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
00b1a426d1
commit
69041b2d9a
1 changed files with 16 additions and 16 deletions
|
|
@ -213,22 +213,22 @@ class ColoredStreamHandler (logging.StreamHandler, object):
|
|||
|
||||
If a formatter is specified, it is used to format the record.
|
||||
The record is then written to the stream with a trailing newline
|
||||
[N.B. this may be removed depending on feedback]. If exception
|
||||
information is present, it is formatted using
|
||||
traceback.print_exception and appended to the stream.
|
||||
[N.B. this may be removed depending on feedback].
|
||||
"""
|
||||
color = self.get_color(record)
|
||||
try:
|
||||
msg = self.format(record)
|
||||
if not hasattr(types, "UnicodeType"): #if no unicode support...
|
||||
# contrary to popular belief I am very interested in log
|
||||
# system exceptions, so disable the bare except clause below
|
||||
#try:
|
||||
msg = self.format(record)
|
||||
if not hasattr(types, "UnicodeType"): #if no unicode support...
|
||||
self.stream.write("%s" % msg, color=color)
|
||||
else:
|
||||
try:
|
||||
self.stream.write("%s" % msg, color=color)
|
||||
else:
|
||||
try:
|
||||
self.stream.write("%s" % msg, color=color)
|
||||
except UnicodeError:
|
||||
self.stream.write("%s" % msg.encode("UTF-8"),
|
||||
color=color)
|
||||
self.stream.write(os.linesep)
|
||||
self.flush()
|
||||
except:
|
||||
self.handleError(record)
|
||||
except UnicodeError:
|
||||
self.stream.write("%s" % msg.encode("UTF-8"),
|
||||
color=color)
|
||||
self.stream.write(os.linesep)
|
||||
self.flush()
|
||||
#except:
|
||||
# self.handleError(record)
|
||||
|
|
|
|||
Loading…
Reference in a new issue