Make use of logging.handlers.WatchedFileHandler if deluge is running on python 2.6.

This commit is contained in:
Pedro Algarvio 2010-12-06 11:59:37 +00:00
parent b7bc1fdb1d
commit 26e45dcbc8

View File

@ -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)