mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 23:09:23 +01:00
Let's use os.linesep instead.
This commit is contained in:
parent
b3dfdd1ed5
commit
dee61a32f1
@ -118,12 +118,15 @@ class BetterFileHandler(logging.FileHandler):
|
|||||||
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(msg)
|
||||||
|
self.stream.write(os.linesep)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.stream.write("%s\n" % msg)
|
self.stream.write(msg)
|
||||||
|
self.stream.write(os.linesep)
|
||||||
except UnicodeError:
|
except UnicodeError:
|
||||||
self.stream.write("%s\n" % msg.encode("UTF-8"))
|
self.stream.write(msg.encode("utf8"))
|
||||||
|
self.stream.write(os.linesep)
|
||||||
self.flush()
|
self.flush()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user