public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: fabbione@sourceware.org
To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com
Subject: Cluster Project branch, master, updated. cluster-2.99.04-58-ga2f1025
Date: Mon, 23 Jun 2008 13:10:00 -0000	[thread overview]
Message-ID: <20080623131039.22063.qmail@sourceware.org> (raw)

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 <fdinitto@redhat.com>
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 <fdinitto@redhat.com>

-----------------------------------------------------------------------

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/logger_subsys[@subsys=\"CCS\"]/@debug");
-  if(res) {
-    if(!debug) {
+    res = do_simple_xml_query(ctx, "/cluster/logging/logger_subsys[@subsys=\"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/logger_subsys[@subsys=\"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/logger_subsys[@subsys=\"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/logger_subsys[@subsys=\"QDISK\"]/@debug", &val) == 0) {
-		if(!*debug) {
+		if (ccs_get(ccsfd, "/cluster/logging/logger_subsys[@subsys=\"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/logger_subsys[@subsys=\"QDISK\"]/@syslog_level", &val) == 0) {
-		loglevel = logsys_priority_id_get (val);
-		if (loglevel < 0)
-			loglevel = LOG_LEVEL_INFO;
+		if (ccs_get(ccsfd, "/cluster/logging/logger_subsys[@subsys=\"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


                 reply	other threads:[~2008-06-23 13:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080623131039.22063.qmail@sourceware.org \
    --to=fabbione@sourceware.org \
    --cc=cluster-cvs@sources.redhat.com \
    --cc=cluster-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).