I’m having difficulty understanding logging in Mopidy. I’m working on a backend and would like some debug logging (while running via systemd).
logging.conf (pointed to by mopidy.conf)
[loggers] keys = root [handlers] keys = fileHandler [formatters] keys = simpleFormatter [logger_root] handlers = fileHandler [handler_fileHandler] class = FileHandler formatter = simpleFormatter level = INFO args = ('/var/log/mopidy/mopidy.log',) [formatter_simpleFormatter] format = %(asctime)s %(levelname)s [%(process)d:%(threadName)s] %(name)s: %(message)s datefmt =
And in my playback.py
import logging from mopidy import backend logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class CalmRadioPlayback(backend.PlaybackProvider): def translate_uri(self, uri): logger.info('Translate URI: %s' % uri) logger.debug('Translate URI (debug): %s' % uri)
I would expect that, explicitly setting the logger level, I would get both info and debug logging … but I get only info. What am I missing? (new to mopidy and python … be kind )