MPDScrobbler: document logging, ensure lowercased values
authorkaliko <kaliko.jack@azylum.org>
Tue, 19 Feb 2013 18:53:35 +0000 (19:53 +0100)
committerkaliko <kaliko.jack@azylum.org>
Tue, 19 Feb 2013 18:53:35 +0000 (19:53 +0100)
misc/MPDScrobbler/mpdscrobbler.py

index e8fcd69..0cbfb5e 100755 (executable)
@@ -24,7 +24,7 @@ except ImportError:
             MPDSERVER   = <MPD server as FQDN or IP>
             MPDPORT     = <MPD port, default to 6600 if not provided>
             LOGFILE     = <full path to log, default to /tmp/mpd_scrobbler.log>
-            LOGLEVEL    = <level, default to info>
+            LOGLEVEL    = <level in (debug, info, warning, error), default to "info">
             """)
     sys.exit(1)
 
@@ -49,7 +49,7 @@ LEVELS = {'debug': logging.DEBUG,
           'error': logging.ERROR,
           'critical': logging.CRITICAL}
 
-logging.basicConfig(format='%(asctime)s  %(levelname)s  %(message)s', level=LEVELS.get(LOGLEVEL))
+logging.basicConfig(format='%(asctime)s  %(levelname)s  %(message)s', level=LEVELS.get(LOGLEVEL.lower()))
 
 class QueuManagement(threading.Thread):