This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".
http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=a2f1025d6e1595475afcdcd68d6f8205ecf99412 The branch, master has been updated via a2f1025d6e1595475afcdcd68d6f8205ecf99412 (commit) from 0b8bd69b8f6a393958229551396057ac44ca5391 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a2f1025d6e1595475afcdcd68d6f8205ecf99412 Author: Fabio M. Di Nitto <[EMAIL PROTECTED]> Date: Mon Jun 23 15:09:33 2008 +0200 [MISC] Logging: optimizing query sequence Query for debug info only if nothing is specified on the command line. Signed-off-by: Fabio M. Di Nitto <[EMAIL PROTECTED]> ----------------------------------------------------------------------- Summary of changes: ccs/daemon/misc.c | 65 ++++++++++++++++++++---------------------- cman/qdisk/main.c | 81 +++++++++++++++++++++++++++-------------------------- 2 files changed, 72 insertions(+), 74 deletions(-) diff --git a/ccs/daemon/misc.c b/ccs/daemon/misc.c index acab5c8..76f63de 100644 --- a/ccs/daemon/misc.c +++ b/ccs/daemon/misc.c @@ -166,22 +166,22 @@ int set_ccs_logging(xmlDocPtr ldoc){ logmode = logsys_config_mode_get(); - res = do_simple_xml_query(ctx, "/cluster/logging/@debug"); - if(res) { - if(!strcmp(res, "on")) { - global_debug = 1; - } else - if(!strcmp(res, "off")) { - global_debug = 0; - } else - log_printf(LOG_ERR, "global debug: unknown value\n"); - free(res); - res=NULL; - } + if(!debug) { + res = do_simple_xml_query(ctx, "/cluster/logging/@debug"); + if(res) { + if(!strcmp(res, "on")) { + global_debug = 1; + } else + if(!strcmp(res, "off")) { + global_debug = 0; + } else + log_printf(LOG_ERR, "global debug: unknown value\n"); + free(res); + res=NULL; + } - res = do_simple_xml_query(ctx, "/cluster/logging/[EMAIL PROTECTED]"CCS\"]/@debug"); - if(res) { - if(!debug) { + res = do_simple_xml_query(ctx, "/cluster/logging/[EMAIL PROTECTED]"CCS\"]/@debug"); + if(res) { if(!strcmp(res, "on")) { debug = 1; } else @@ -189,28 +189,25 @@ int set_ccs_logging(xmlDocPtr ldoc){ debug = 0; } else log_printf(LOG_ERR, "subsys debug: unknown value\n"); - } - free(res); - res=NULL; - } else - debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ - - if(debug) - logsys_config_priority_set (LOG_LEVEL_DEBUG); + free(res); + res=NULL; + } else + debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ - res = do_simple_xml_query(ctx, "/cluster/logging/[EMAIL PROTECTED]"CCS\"]/@syslog_level"); - if(res) { - loglevel = logsys_priority_id_get (res); - if (loglevel < 0) - loglevel = LOG_LEVEL_INFO; + res = do_simple_xml_query(ctx, "/cluster/logging/[EMAIL PROTECTED]"CCS\"]/@syslog_level"); + if(res) { + loglevel = logsys_priority_id_get (res); + if (loglevel < 0) + loglevel = LOG_LEVEL_INFO; - if (!debug) - logsys_config_priority_set (loglevel); + if(!debug) + logsys_config_priority_set (loglevel); - log_printf(LOG_DEBUG, "syslog_level: %s (%d).\n", res, loglevel); - free(res); - res=NULL; - } + free(res); + res=NULL; + } + } else + logsys_config_priority_set (LOG_LEVEL_DEBUG); res = do_simple_xml_query(ctx, "/cluster/logging/@to_stderr"); if(res) { diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c index 466609a..4202508 100644 --- a/cman/qdisk/main.c +++ b/cman/qdisk/main.c @@ -1077,59 +1077,60 @@ get_logsys_config_data(int *debug) logmode = logsys_config_mode_get(); - if (ccs_get(ccsfd, "/cluster/logging/@debug", &val) == 0) { - if(!strcmp(val, "on")) { - global_debug = 1; - } else - if(!strcmp(val, "off")) { - global_debug = 0; - } else - log_printf(LOG_ERR, "global debug: unknown value\n"); - free(val); - val = NULL; - } + if (!debug) { + if (ccs_get(ccsfd, "/cluster/logging/@debug", &val) == 0) { + if(!strcmp(val, "on")) { + global_debug = 1; + } else + if(!strcmp(val, "off")) { + global_debug = 0; + } else + log_printf(LOG_ERR, "global debug: unknown value\n"); + free(val); + val = NULL; + } - if (ccs_get(ccsfd, "/cluster/logging/[EMAIL PROTECTED]"QDISK\"]/@debug", &val) == 0) { - if(!*debug) { + if (ccs_get(ccsfd, "/cluster/logging/[EMAIL PROTECTED]"QDISK\"]/@debug", &val) == 0) { if(!strcmp(val, "on")) { *debug = 1; } else - if(!strcmp(val, "off") && !*debug) { /* debug from cmdline/envvars override config */ + if(!strcmp(val, "off")) { /* debug from cmdline/envvars override config */ *debug = 0; } else log_printf(LOG_ERR, "subsys debug: unknown value: %s\n", val); - free(val); - val = NULL; - } - } else - *debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ + free(val); + val = NULL; + } else + *debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ - if (ccs_get(ccsfd, "/cluster/logging/[EMAIL PROTECTED]"QDISK\"]/@syslog_level", &val) == 0) { - loglevel = logsys_priority_id_get (val); - if (loglevel < 0) - loglevel = LOG_LEVEL_INFO; + if (ccs_get(ccsfd, "/cluster/logging/[EMAIL PROTECTED]"QDISK\"]/@syslog_level", &val) == 0) { + loglevel = logsys_priority_id_get (val); + if (loglevel < 0) + loglevel = LOG_LEVEL_INFO; - if (!*debug) { - *debug = 1; - logsys_config_priority_set (loglevel); - } + if (!*debug) { + *debug = 1; + logsys_config_priority_set (loglevel); + } - free(val); - } else - if (ccs_get(ccsfd, "/cluster/quorumd/@log_level", &val) == 0) { /* check backward compat options */ - loglevel = logsys_priority_id_get (val); - if (loglevel < 0) - loglevel = LOG_LEVEL_INFO; + free(val); + } else + if (ccs_get(ccsfd, "/cluster/quorumd/@log_level", &val) == 0) { /* check backward compat options */ + loglevel = logsys_priority_id_get (val); + if (loglevel < 0) + loglevel = LOG_LEVEL_INFO; - log_printf(LOG_ERR, "<quorumd log_level=\"%s\".. option is depracated\n", val); + log_printf(LOG_ERR, "<quorumd log_level=\"%s\".. option is depracated\n", val); - if (!*debug) { - *debug = 1; - logsys_config_priority_set (loglevel); - } + if (!*debug) { + *debug = 1; + logsys_config_priority_set (loglevel); + } - free(val); - } + free(val); + } + } else + logsys_config_priority_set (LOG_LEVEL_DEBUG); if (ccs_get(ccsfd, "/cluster/logging/@to_stderr", &val) == 0) { if(!strcmp(val, "yes")) { hooks/post-receive -- Cluster Project
