[#2808] Fix: Deluge Log File Not Working as Intended

This commit is contained in:
bendikro 2016-04-20 14:09:50 +02:00
parent 2dea6ab5a5
commit 58bc8b6ec7
1 changed files with 4 additions and 4 deletions

View File

@ -135,10 +135,10 @@ def setup_logger(level="error", filename=None, filemode="w", logrotate=None):
backupCount=5, encoding="utf-8"
)
elif filename and filemode == "w":
handler = getattr(
logging.handlers, "WatchedFileHandler", logging.FileHandler)(
filename, mode=filemode, encoding="utf-8"
)
handler_cls = logging.FileHandler
if not common.windows_check():
handler_cls = getattr(logging.handlers, "WatchedFileHandler", logging.FileHandler)
handler = handler_cls(filename, mode=filemode, encoding="utf-8")
else:
handler = logging.StreamHandler(stream=sys.stdout)