From: Alexander Kanevskiy Date: Thu, 15 Aug 2013 19:16:12 +0000 (+0300) Subject: Improve logging settings X-Git-Tag: submit/devel/20190730.075356~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd7c94867b1ad4104e4e9836573b3d0c813a8718;p=services%2Fgerrithooks.git Improve logging settings --- diff --git a/gerrithooks-log.conf b/gerrithooks-log.conf index 8e8606d..83178e1 100644 --- a/gerrithooks-log.conf +++ b/gerrithooks-log.conf @@ -30,4 +30,4 @@ formatter=simpleFormatter args=("%(syslog_socket)s",) [formatter_simpleFormatter] -format=%(name)s - %(levelname)s - %(message)s +format=%(name)s[%(process)d] - %(levelname)s - %(message)s diff --git a/gerrithooks/common.py b/gerrithooks/common.py index 344859c..23c9ef1 100644 --- a/gerrithooks/common.py +++ b/gerrithooks/common.py @@ -33,7 +33,7 @@ def run_plugin_hooks(hook, parser): """ # set up logger - logger = configure_logging(os.path.basename(sys.argv[0])) + logger = configure_logging("gerrithooks") # get parameters from command line params = parser(sys.argv[1:]) @@ -46,12 +46,12 @@ def run_plugin_hooks(hook, parser): if not (key.startswith("_") or key =="debug") ]) params_string = ", ".join(["%s: %s" % (key, getattr(params, key)) for key in params_keys ]) - logger.info("Event %s: %s", hook, params_string) - if not 'debug' in params or not params.debug: logger.debug("Daemonizing...") daemonize() + logger.info("Event %s: %s", hook, params_string) + logger.debug("looking for config") confname = "gerrithooks.conf" conf = find_config(confname, subdir="gerrithooks") @@ -62,7 +62,7 @@ def run_plugin_hooks(hook, parser): # read rules from configuration file config = ConfigParser.RawConfigParser() - #config.optionxform = str + config.optionxform = str logger.debug("runner: reading config from %s", conf) config.read(conf)