1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 17:06:17 +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,7 +253,10 @@ class SupysonicWatcher(object):
def run(self):
if self.__config.DAEMON['log_file']:
log_handler = TimedRotatingFileHandler(self.__config.DAEMON['log_file'], when = 'midnight')
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.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(message)s"))
else:
log_handler = logging.StreamHandler()

View File

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