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:
parent
e5c471340e
commit
1cff3cedcb
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user