Print

Print


Commit in slic/include on MAIN
LogStream.hh+29-51.6 -> 1.7
minor reformatting; set default level to always

slic/include
LogStream.hh 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- LogStream.hh	27 Nov 2012 19:32:18 -0000	1.6
+++ LogStream.hh	28 Nov 2012 23:08:03 -0000	1.7
@@ -18,17 +18,31 @@
 using std::ios_base;
 
 namespace LOG {
+
 enum EManip {
-	done, head, time, level, name, sep, endl
+	done = 101,
+	head = 102,
+	time = 103,
+	level = 104,
+	name = 105,
+	sep = 106,
+	endl  = 107
 };
 
 enum ELevel {
-	none = 0, always, fatal, error, warning, okay, verbose, debug, nlevels
+	none = 0,
+	always = 1,
+	fatal = 2,
+	error = 3,
+	warning = 4,
+	okay = 5,
+	verbose = 6,
+	debug = 7,
+	nlevels = 8
 };
 }
 
-static std::string levelNames[LOG::nlevels] = { "NONE", "ALWAYS", "FATAL", "ERROR", "WARNING", "OKAY",
-		"VERBOSE", "DEBUG" };
+static std::string levelNames[LOG::nlevels] = { "NONE", "ALWAYS", "FATAL", "ERROR", "WARNING", "OKAY", "VERBOSE", "DEBUG" };
 
 namespace slic {
 
@@ -58,7 +72,7 @@
 	}
 
 	LogStream() :
-			m_name("NONE"), m_outputLevel(LOG::okay), m_currentMessageLevel(LOG::okay), m_os(&std::cout), m_active(
+			m_name("NONE"), m_outputLevel(LOG::always), m_currentMessageLevel(LOG::okay), m_os(&std::cout), m_active(
 					true), m_fos(0) {
 		;
 	}
@@ -105,7 +119,17 @@
 	 * discarded.
 	 */
 	LogStream& operator <<(const LOG::ELevel& x) {
+
+		//std::cout << "setting level: " << x << std::endl;
+		//std::cout << "current level: " << getCurrentLevel() << std::endl;
+
 		setCurrentLevel(x);
+
+		//std::cout << "name: " << m_name << std::endl;
+		//std::cout << "current level: " << getCurrentLevel() << std::endl;
+		//std::cout << "output level: " << getOutputLevel() << std::endl;
+		//std::cout << std::endl;
+
 		if (getCurrentLevel() <= getOutputLevel()) {
 			// Set active state.
 			setActive(true);
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1