1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-08 22:07:55 +00:00

web/lib/utils.py: bugfix: take WatchedFileHandler properly

This commit is contained in:
Hidden Z 2010-10-31 18:38:27 +00:00
parent e5c471340e
commit 1cff3cedcb

View File

@ -1,4 +1,5 @@
import logging
from logging import handlers
def get_logger(filename=None, log_level='debug'):
""" Prepare logger instance for our scripts """
@ -16,7 +17,7 @@ def get_logger(filename=None, log_level='debug'):
logger = logging.getLogger(__name__)
logger.setLevel(level)
if filename:
handler = logging.WatchedFileHandler(filename)
handler = logging.handlers.WatchedFileHandler(filename)
else:
handler = logging.StreamHandler()
handler.setFormatter(formatter)