From 69104a211133f451e1df772a86a7665f975e32a9 Mon Sep 17 00:00:00 2001 From: vbd Date: Thu, 23 Aug 2007 14:21:27 +0000 Subject: [PATCH] staffan : added some simple logging macros --- src/INTERP_KERNEL/Log.hxx | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/INTERP_KERNEL/Log.hxx diff --git a/src/INTERP_KERNEL/Log.hxx b/src/INTERP_KERNEL/Log.hxx new file mode 100644 index 000000000..c3adaf883 --- /dev/null +++ b/src/INTERP_KERNEL/Log.hxx @@ -0,0 +1,40 @@ +#ifndef _LOG_H_ +#define _LOG_H_ + +/* Simple pre-processor logging utility. + * Replaces LOG( x ) with "if(x <= LOG_LEVEL) std::cout" when logging is active (LOG_ACTIVE defined) + * x is the level at which the message should be logged. + * + * + * + */ + + + +#define LOG_ACTIVE + +#ifdef LOG_ACTIVE + +#include + +#define LOG_LEVEL 1 + +#define LOG(x, msg) if(x <= LOG_LEVEL) std::cout << msg << std::endl; + +#else + +#define LOG(x, msg) + +#endif + + + + + + + + + + + +#endif -- 2.39.2