summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/runtime
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-06-08 12:15:42 -0400
committerTom Rondeau <trondeau@vt.edu>2012-06-08 12:15:42 -0400
commitd71d02d7eb01b56b842d6a71a2b7d087c5513e7b (patch)
tree27dd93e12a85fac6dc7bd2bfb3d22b94d073918c /gnuradio-core/src/lib/runtime
parenta14010ec147e3c86f93245d34be58548493aaed1 (diff)
Fixing up the gr-log capabilities.
Better handling of enable/disable function, easier integration with all components if log4cxx is or is not there. All components have been updated to be able to use logging. Docs update, too.
Diffstat (limited to 'gnuradio-core/src/lib/runtime')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_log.h49
-rw-r--r--gnuradio-core/src/lib/runtime/gr_log.i4
-rw-r--r--gnuradio-core/src/lib/runtime/qa_gr_log.cc2
3 files changed, 28 insertions, 27 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_log.h b/gnuradio-core/src/lib/runtime/gr_log.h
index 1a52d2aef6..4f718567df 100644
--- a/gnuradio-core/src/lib/runtime/gr_log.h
+++ b/gnuradio-core/src/lib/runtime/gr_log.h
@@ -37,29 +37,7 @@
*
*/
-//If DISABLE_GR_LOG set then clear all logging macros
-#ifdef DISABLE_GR_LOG
-
-#define GR_CONFIG_LOGGER(config)
-#define GR_LOG_GETLOGGER(logger, name)
-#define GR_TRACE(name, msg)
-#define GR_DEBUG(name, msg)
-#define GR_INFO(name, msg)
-#define GR_WARN(name, msg)
-#define GR_ERROR(name, msg)
-#define GR_FATAL(name, msg)
-#define GR_ERRORIF(name, cond, msg)
-#define GR_ASSERT(name, cond, msg)
-#define GR_LOG_TRACE(logger, msg)
-#define GR_LOG_DEBUG(logger, msg)
-#define GR_LOG_INFO(logger, msg)
-#define GR_LOG_WARN(logger, msg)
-#define GR_LOG_ERROR(logger, msg)
-#define GR_LOG_FATAL(logger, msg)
-#define GR_LOG_ERRORIF(logger, cond, msg)
-#define GR_LOG_ASSERT(logger, cond, msg)
-
-#else
+#ifdef ENABLE_GR_LOG
#include <stdio.h>
#include <string>
@@ -262,5 +240,28 @@ class gr_log
void log_assert(LoggerPtr logger,bool cond,std::string msg){GR_LOG_ASSERT(logger,cond,msg);};
};
-#endif /* DISABLE_GR_LOG */
+
+//If ENABLE_GR_LOG not set then clear all logging macros
+#else
+
+#define GR_CONFIG_LOGGER(config)
+#define GR_LOG_GETLOGGER(logger, name)
+#define GR_TRACE(name, msg)
+#define GR_DEBUG(name, msg)
+#define GR_INFO(name, msg)
+#define GR_WARN(name, msg)
+#define GR_ERROR(name, msg)
+#define GR_FATAL(name, msg)
+#define GR_ERRORIF(name, cond, msg)
+#define GR_ASSERT(name, cond, msg)
+#define GR_LOG_TRACE(logger, msg)
+#define GR_LOG_DEBUG(logger, msg)
+#define GR_LOG_INFO(logger, msg)
+#define GR_LOG_WARN(logger, msg)
+#define GR_LOG_ERROR(logger, msg)
+#define GR_LOG_FATAL(logger, msg)
+#define GR_LOG_ERRORIF(logger, cond, msg)
+#define GR_LOG_ASSERT(logger, cond, msg)
+
+#endif /* ENABLE_GR_LOG */
#endif /* INCLUDED_GR_LOG_H */
diff --git a/gnuradio-core/src/lib/runtime/gr_log.i b/gnuradio-core/src/lib/runtime/gr_log.i
index d56edd4f37..e539c5528b 100644
--- a/gnuradio-core/src/lib/runtime/gr_log.i
+++ b/gnuradio-core/src/lib/runtime/gr_log.i
@@ -40,7 +40,7 @@
//-----------------------------------
-#ifndef DISABLE_GR_LOG
+#ifdef ENABLE_GR_LOG
%{
// The .h files
@@ -82,4 +82,4 @@ public:
void log_assert(LoggerPtr logger,bool cond,std::string msg);
};
-#endif
+#endif /* ENABLE_GR_LOG */
diff --git a/gnuradio-core/src/lib/runtime/qa_gr_log.cc b/gnuradio-core/src/lib/runtime/qa_gr_log.cc
index d8d0914992..a973408028 100644
--- a/gnuradio-core/src/lib/runtime/qa_gr_log.cc
+++ b/gnuradio-core/src/lib/runtime/qa_gr_log.cc
@@ -35,7 +35,7 @@
void
qa_gr_log::t1()
{
-#ifndef DISABLE_GR_LOG
+#ifdef ENABLE_GR_LOG
// This doesn't really test anything, more just
// making sure nothing's gone horribly wrong.
GR_LOG_GETLOGGER(LOG,"errLoggerRoot");