cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci include/Logger.h modules/cluster/c ...
Date: 26 Sep 2007 21:35:20 -0000	[thread overview]
Message-ID: <20070926213520.1719.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-09-26 21:35:20

Modified files:
	ricci/include  : Logger.h 
	ricci/modules/cluster/clumon/src/daemon: main.cpp 

Log message:
	Set the log mask to LogAll when debug is enabled

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Logger.h.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/main.cpp.diff?cvsroot=cluster&r1=1.7&r2=1.8

--- conga/ricci/include/Logger.h	2007/09/18 21:01:00	1.5
+++ conga/ricci/include/Logger.h	2007/09/26 21:35:20	1.6
@@ -27,17 +27,19 @@
 #include "String.h"
 
 enum LogLevel {
-	LogNone			= 0,
-	LogBasic		= 1,
-	LogMonitor		= 2,
-	LogSocket		= 4,
-	LogCommunicator	= 8,
-	LogTransfer		= 16,
-	LogExit			= 32,
-	LogThread		= 64,
-	LogTime			= 128,
-	LogExecute		= 256,
-	LogAll			= ~0
+	LogNone			= 0x00000000,
+	LogBasic		= 0x00000001,
+	LogMonitor		= 0x00000002,
+	LogSocket		= 0x00000004,
+	LogCommunicator	= 0x00000008,
+	LogTransfer		= 0x00000010,
+	LogExit			= 0x00000020,
+	LogThread		= 0x00000040,
+	LogTime			= 0x00000080,
+	LogExecute		= 0x00000100,
+	LogExecFail		= 0x00000200,
+	LogDebug		= 0x00000400,
+	LogAll			= 0xffffffff
 };
 
 class Logger
@@ -51,11 +53,12 @@
 		ssize_t log(const String& msg, LogLevel level=LogBasic);
 		ssize_t log_sigsafe(const char* msg, LogLevel level=LogBasic);
 		void operator<< (const String& msg) { log(msg); }
+		uint32_t get_mask(void) { return _level; }
 
 	private:
 		int _fd;
 		char *_domain_c;
-		int _level;
+		uint32_t _level;
 
 		void close_fd();
 
--- conga/ricci/modules/cluster/clumon/src/daemon/main.cpp	2007/09/18 20:16:27	1.7
+++ conga/ricci/modules/cluster/clumon/src/daemon/main.cpp	2007/09/26 21:35:20	1.8
@@ -95,8 +95,12 @@
 	}
 
 	if (v_level < 0) {
-		cout << "Setting verbosity level to LogBasic" << endl;
-		v_level = LogBasic;
+		if (debug) {
+			cout << "Setting verbosity level to LogAll" << endl;
+		} else {
+			cout << "Setting verbosity level to LogBasic" << endl;
+			v_level = LogBasic;
+		}
 	}
 
 	if (foreground)



                 reply	other threads:[~2007-09-26 21:35 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=20070926213520.1719.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /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 NNTP newsgroup(s).