From: kaliko Date: Fri, 20 Jun 2014 18:19:18 +0000 (+0200) Subject: Removed timestamp for console logging X-Git-Tag: 0.12.1~1 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;ds=sidebyside;h=f036019a4f5ce8b43d0c1b704ae1a67e36b6b6ac;p=mpd-sima.git Removed timestamp for console logging --- diff --git a/doc/Changelog b/doc/Changelog index 54209d1..4c66815 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 UNRELEASED diff --git a/sima/lib/logger.py b/sima/lib/logger.py index 05f9c35..b27d4f0 100644 --- a/sima/lib/logger.py +++ b/sima/lib/logger.py @@ -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)