|
[Rivet-svn] r2955 - in trunk/include/Rivet: . Toolsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue Feb 22 23:41:31 GMT 2011
Author: buckley Date: Tue Feb 22 23:41:30 2011 New Revision: 2955 Log: Moving logging macros into the logging framework Modified: trunk/include/Rivet/ProjectionApplier.hh trunk/include/Rivet/Tools/Logging.hh Modified: trunk/include/Rivet/ProjectionApplier.hh ============================================================================== --- trunk/include/Rivet/ProjectionApplier.hh Tue Feb 22 17:44:22 2011 (r2954) +++ trunk/include/Rivet/ProjectionApplier.hh Tue Feb 22 23:41:30 2011 (r2955) @@ -9,21 +9,6 @@ #include "Rivet/ProjectionHandler.hh" #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 { Modified: trunk/include/Rivet/Tools/Logging.hh ============================================================================== --- trunk/include/Rivet/Tools/Logging.hh Tue Feb 22 17:44:22 2011 (r2954) +++ trunk/include/Rivet/Tools/Logging.hh Tue Feb 22 23:41:30 2011 (r2955) @@ -168,4 +168,20 @@ } +// Neat CPU-conserving logging macros. Use by preference! +// NB. Only usable in classes where a getLog() method is provided +#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) + + #endif
More information about the Rivet-svn mailing list |