1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-23 01:16:18 +00:00

Fixed issues when the watcher is set to log to /dev/null

This commit is contained in:
spl0k 2019-03-23 16:20:19 +01:00
parent c0d9d616c8
commit e2cc51a0f0
2 changed files with 5 additions and 2 deletions

View File

@ -253,6 +253,9 @@ class SupysonicWatcher(object):
def run(self): def run(self):
if self.__config.DAEMON['log_file']: if self.__config.DAEMON['log_file']:
if self.__config.DAEMON['log_file'] == '/dev/null':
log_handler = logging.NullHandler()
else:
log_handler = TimedRotatingFileHandler(self.__config.DAEMON['log_file'], when = 'midnight') log_handler = TimedRotatingFileHandler(self.__config.DAEMON['log_file'], when = 'midnight')
log_handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(message)s")) log_handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(message)s"))
else: else:

View File

@ -83,7 +83,7 @@ class FolderTestCase(FrontendTestBase):
with db_session: with db_session:
folder = Folder( folder = Folder(
name = 'folder', name = 'folder',
path = 'tests/assets', path = 'tests/assets/folder',
root = True, root = True,
) )