mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
fix error in logger. catch bad log messages. #424
This commit is contained in:
parent
66e1f40789
commit
c65e860502
1 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,6 @@ import sys
|
||||||
import threading
|
import threading
|
||||||
import logging
|
import logging
|
||||||
import nzbtomedia
|
import nzbtomedia
|
||||||
from nzbtomedia.nzbToMediaUtil import CharReplace
|
|
||||||
|
|
||||||
# number of log files to keep
|
# number of log files to keep
|
||||||
NUM_LOGS = 3
|
NUM_LOGS = 3
|
||||||
|
@ -191,9 +190,10 @@ class NTMRotatingLogHandler(object):
|
||||||
else:
|
else:
|
||||||
self.writes_since_check += 1
|
self.writes_since_check += 1
|
||||||
|
|
||||||
encoded, toLog = CharReplace(toLog) # Make sure log message can be written.
|
try:
|
||||||
|
|
||||||
message = u"%s: %s" % (str(section).upper(), toLog)
|
message = u"%s: %s" % (str(section).upper(), toLog)
|
||||||
|
except:
|
||||||
|
message = u"%s: Message contains non-utf-8 string" % (str(section).upper())
|
||||||
|
|
||||||
out_line = message
|
out_line = message
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue