[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Jan Luebbe jluebbe at debian.org
Mon Feb 2 18:52:06 UTC 2009


The following commit has been merged in the master branch:
commit c53125a8f1814546407d6a92e6a5959a6925e97f
Author: Timo Juhani Lindfors <timo.lindfors at iki.fi>
Date:   Wed Jan 28 09:02:01 2009 +0100

    config: do not send timestamps to syslog since syslog already adds time
    
    This patch makes frameworkd not log timestamps when it is
    logging to syslog. Syslog already adds timestamps so extra timestamp
    is just making the log lines longer for no good reason.

diff --git a/framework/config.py b/framework/config.py
index cc5b87e..25c0391 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -81,16 +81,19 @@ rootlogger.setLevel( loggingmap.get( debug, logging.INFO ) )
 for handler in rootlogger.handlers:
     rootlogger.removeHandler( handler )
 
-# now that we are clean, setup our actual handler
+# now that we are clean, setup our actual handler and configure formatter
 if debugto == "stderr":
     handler = logging.StreamHandler() # default=stderr
+    handler.setFormatter( logging.Formatter( "%(asctime)s %(name)-8s %(levelname)-8s %(message)s", datefmt="%Y.%m.%d %H:%M:%S" ) )
 elif debugto == "file":
     handler = logging.FileHandler( debugdest )
+    handler.setFormatter( logging.Formatter( "%(asctime)s %(name)-8s %(levelname)-8s %(message)s", datefmt="%Y.%m.%d %H:%M:%S" ) )
 elif debugto == "syslog":
     handler = logging.handlers.SysLogHandler( address = "/dev/log" )
+    # timestamps are not needed with syslog
+    handler.setFormatter( logging.Formatter( "%(name)-8s %(levelname)-8s %(message)s" ) )
 
-# configure the formatter and set the handler
-handler.setFormatter( logging.Formatter( "%(asctime)s %(name)-8s %(levelname)-8s %(message)s", datefmt="%Y.%m.%d %H:%M:%S" ) )
+# set the handler
 rootlogger.addHandler( handler )
 
 #

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list