fix logging
This commit is contained in:
+8
-2
@@ -84,6 +84,7 @@ set(GR_REQUIRED_COMPONENTS RUNTIME FILTER FFT PMT DIGITAL)
|
|||||||
find_package(Gnuradio)
|
find_package(Gnuradio)
|
||||||
find_package(CppUnit)
|
find_package(CppUnit)
|
||||||
find_package(ITPP)
|
find_package(ITPP)
|
||||||
|
find_package(log4cpp)
|
||||||
|
|
||||||
if(NOT GNURADIO_RUNTIME_FOUND)
|
if(NOT GNURADIO_RUNTIME_FOUND)
|
||||||
message(FATAL_ERROR "GnuRadio Runtime required to compile ieee802-11")
|
message(FATAL_ERROR "GnuRadio Runtime required to compile ieee802-11")
|
||||||
@@ -97,6 +98,13 @@ if(NOT ITPP_FOUND)
|
|||||||
message(FATAL_ERROR "ITPP required to compile ieee802-11")
|
message(FATAL_ERROR "ITPP required to compile ieee802-11")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (LOG4CPP_FOUND)
|
||||||
|
message(STATUS "Found LOG4CPP: ${LOG4CPP_LIBRARIES}")
|
||||||
|
add_definitions("-DGR_IEEE80211_LOG4CPP")
|
||||||
|
else ()
|
||||||
|
message(STATUS "LOG4CPP not found (not required).")
|
||||||
|
endif ()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# On Apple only, set install name and use rpath correctly, if not already set
|
# On Apple only, set install name and use rpath correctly, if not already set
|
||||||
########################################################################
|
########################################################################
|
||||||
@@ -128,14 +136,12 @@ include_directories(
|
|||||||
${CPPUNIT_INCLUDE_DIRS}
|
${CPPUNIT_INCLUDE_DIRS}
|
||||||
${ITPP_INCLUDE_DIR}
|
${ITPP_INCLUDE_DIR}
|
||||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||||
${LOG4CPP_INCLUDE_DIRS}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(
|
link_directories(
|
||||||
${Boost_LIBRARY_DIRS}
|
${Boost_LIBRARY_DIRS}
|
||||||
${CPPUNIT_LIBRARY_DIRS}
|
${CPPUNIT_LIBRARY_DIRS}
|
||||||
${GNURADIO_RUNTIME_LIBRARY_DIRS}
|
${GNURADIO_RUNTIME_LIBRARY_DIRS}
|
||||||
${LOG4CPP_LIBRARY_DIRS}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|||||||
+2
-2
@@ -28,8 +28,8 @@ const int MAX_BITS = 1550 * 8 * 2;
|
|||||||
|
|
||||||
#define dout d_debug && std::cout
|
#define dout d_debug && std::cout
|
||||||
|
|
||||||
#if defined(HAVE_LOG4CPP) && defined(ENABLE_GR_LOG)
|
#if defined(HAVE_LOG4CPP) && defined(ENABLE_GR_LOG) && defined(GR_IEEE80211_LOG4CPP)
|
||||||
#define mylog(msg) do { if(d_log) { *d_logger << log4cpp::Priority::INFO << msg << log4cpp::eol; }} while(0);
|
#define mylog(msg) do { if(d_log) { GR_LOG_INFO(d_logger, msg) }} while(0);
|
||||||
#else
|
#else
|
||||||
#define mylog(msg) do { d_log && std::cout << msg << std::endl; } while(0);
|
#define mylog(msg) do { d_log && std::cout << msg << std::endl; } while(0);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user