[Rivet-svn] r2515 - in trunk: . include/Rivet

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Jun 23 12:50:37 BST 2010


Author: buckley
Date: Wed Jun 23 12:50:41 2010
New Revision: 2515

Log:
Providing protected logging macros, MSG_INFO, MSG_DEBUG, MSG_TRACE, etc.

Modified:
   trunk/ChangeLog
   trunk/include/Rivet/ProjectionApplier.hh

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Wed Jun 23 12:50:12 2010	(r2514)
+++ trunk/ChangeLog	Wed Jun 23 12:50:41 2010	(r2515)
@@ -1,5 +1,8 @@
 2010-06-23  Andy Buckley  <andy at insectnation.org>
 
+	* Providing protected log messaging macros,
+	MSG_{TRACE,DEBUG,INFO,WARNING,ERROR} cf. Athena.
+
 	* Adding environment-aware functions for Rivet search path list access.
 
 2010-06-21  Andy Buckley  <andy at insectnation.org>

Modified: trunk/include/Rivet/ProjectionApplier.hh
==============================================================================
--- trunk/include/Rivet/ProjectionApplier.hh	Wed Jun 23 12:50:12 2010	(r2514)
+++ trunk/include/Rivet/ProjectionApplier.hh	Wed Jun 23 12:50:41 2010	(r2515)
@@ -10,6 +10,20 @@
 #include "Rivet/Tools/Logging.hh"
 
 
+#define MSG_LVL(lvl, x) \
+  do { \
+    if (this->getLog().isActive(lvl)) { \
+      this->getLog() << lvl << x << endl;   \
+    } \
+  } while (0)
+
+#define MSG_TRACE(x)   MSG_LVL(Log::TRACE, x)
+#define MSG_DEBUG(x)   MSG_LVL(Log::DEBUG, x)
+#define MSG_INFO(x)    MSG_LVL(Log::INFO, x)
+#define MSG_WARNING(x) MSG_LVL(Log::WARNING, x)
+#define MSG_ERROR(x)   MSG_LVL(Log::ERROR, x)
+
+
 namespace Rivet {
 
 


More information about the Rivet-svn mailing list