Don't traceback when writing zero-length message
This commit is contained in:
parent
232ae8d082
commit
f0e773db38
@ -57,7 +57,7 @@ class LogWriter:
|
||||
elif level == STDOUT_LEVEL:
|
||||
level_txt = 'STDOUT'
|
||||
|
||||
if msg[len(msg) - 1] != '\n':
|
||||
if not len(msg) or msg[len(msg) - 1] != '\n':
|
||||
msg += "\n"
|
||||
fmt = "%.4f %s - %s" % (time.time(), level_txt, msg)
|
||||
fmt = fmt.encode("utf8")
|
||||
|
Loading…
Reference in New Issue
Block a user