mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Changed eIds/eStrIds.
This commit is contained in:
parent
9100151f95
commit
fd5463a06b
@ -64,7 +64,7 @@ class Logger(logging.Logger):
|
|||||||
def exception(self, *args):
|
def exception(self, *args):
|
||||||
(E, e, tb) = sys.exc_info()
|
(E, e, tb) = sys.exc_info()
|
||||||
tbinfo = traceback.extract_tb(tb)
|
tbinfo = traceback.extract_tb(tb)
|
||||||
path = '/'.join(map(operator.itemgetter(2), tbinfo))
|
path = '[%s]' % '|'.join(map(operator.itemgetter(2), tbinfo))
|
||||||
eStrId = '%s:%s' % (E, path)
|
eStrId = '%s:%s' % (E, path)
|
||||||
eId = hash(eStrId) & 0xFFFF
|
eId = hash(eStrId) & 0xFFFF
|
||||||
logging.Logger.exception(self, *args)
|
logging.Logger.exception(self, *args)
|
||||||
@ -75,12 +75,12 @@ class BetterStreamHandler(logging.StreamHandler):
|
|||||||
def emit(self, record):
|
def emit(self, record):
|
||||||
msg = self.format(record)
|
msg = self.format(record)
|
||||||
if not hasattr(types, "UnicodeType"): #if no unicode support...
|
if not hasattr(types, "UnicodeType"): #if no unicode support...
|
||||||
self.stream.write("%s\n" % msg)
|
self.stream.write("%s%s" % (msg, os.linesep))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.stream.write("%s\n" % msg)
|
self.stream.write("%s%s" % (msg, os.linesep))
|
||||||
except UnicodeError:
|
except UnicodeError:
|
||||||
self.stream.write("%s\n" % msg.encode("UTF-8"))
|
self.stream.write("%s%s" % (msg.encode("UTF-8"), os.linesep))
|
||||||
self.flush()
|
self.flush()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user