]> kaliko git repositories - mpd-sima.git/commitdiff
Removed timestamp for console logging
authorkaliko <kaliko@azylum.org>
Fri, 20 Jun 2014 18:19:18 +0000 (20:19 +0200)
committerkaliko <kaliko@azylum.org>
Fri, 20 Jun 2014 18:19:18 +0000 (20:19 +0200)
doc/Changelog
sima/lib/logger.py

index 54209d11506cf2c494bc7cb82eb456dc5420368b..4c668155697947316246d312308f8070a6e43516 100644 (file)
@@ -2,7 +2,8 @@ MPD_sima v0.12.1
 
  * Fixed SIGHUP error, need python-musicpd >= 0.4.1
  * Add core plugin to detect multiple MPD_sima instance on the same MPD host
- * fixed startup robustness
+ * Fixed startup robustness
+ * Removed timestamp in console logging
 
 -- kaliko jack <kaliko@azylum.org> UNRELEASED
 
index 05f9c35011e120ed07077077dd0c42d45ac22b9e..b27d4f07f15ca15e689c944a8a80fb83dfcc5468 100644 (file)
@@ -28,8 +28,8 @@ import sys
 
 
 LOG_FORMATS = {
-        logging.DEBUG: '{asctime} {filename: >11}:{lineno: <3} {levelname: <7}: {message}',
-        logging.INFO:  '{asctime} {levelname: <7}: {message}',
+        logging.DEBUG: '[{process}]{filename: >11}:{lineno: <3} {levelname: <7}: {message}',
+        logging.INFO:  '{levelname: <7}: {message}',
         #logging.DEBUG: '{asctime} {filename}:{lineno}({funcName}) '
                                  #'{levelname}: {message}',
         }
@@ -78,6 +78,9 @@ def set_logger(level='info', logfile=None):
     if logfile:
         if filehdl:
             logg.handlers = []
+        # Add timestamp for file handler
+        log_format = '{0} {1}'.format('{asctime}', log_format)
+        formatter = logging.Formatter(log_format, DATE_FMT, '{')
         # create file handler
         fileh = logging.FileHandler(logfile)
         #fileh.setLevel(user_log_level)