mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 20:44:50 +00:00
Make use of logging.handlers.WatchedFileHandler
if deluge is running on python 2.6.
This commit is contained in:
parent
b7bc1fdb1d
commit
26e45dcbc8
@ -155,7 +155,9 @@ def setupLogger(level="error", filename=None, filemode="w"):
|
||||
delay=0
|
||||
)
|
||||
elif filename and filemode=='w':
|
||||
handler = logging.FileHandler(filename, filemode, 'utf-8', delay=0)
|
||||
getattr(logging.handlers, 'WatchedFileHandler', logging.FileHandler)(
|
||||
filename, filemode, 'utf-8', delay=0
|
||||
)
|
||||
else:
|
||||
handler = logging.StreamHandler()
|
||||
handler.setLevel(level)
|
||||
|
Loading…
x
Reference in New Issue
Block a user