diff --git a/river/debug.h b/river/debug.h index 6710c7d..fcbe591 100644 --- a/river/debug.h +++ b/river/debug.h @@ -13,16 +13,7 @@ namespace river { int32_t getLogId(); }; -// TODO : Review this problem of multiple intanciation of "std::stringbuf sb" -#define RIVER_BASE(info,data) \ - do { \ - if (info <= etk::log::getLevel(river::getLogId())) { \ - std::stringbuf sb; \ - std::ostream tmpStream(&sb); \ - tmpStream << data; \ - etk::log::logStream(river::getLogId(), info, __LINE__, __class__, __func__, tmpStream); \ - } \ - } while(0) +#define RIVER_BASE(info,data) TK_LOG_BASE(river::getLogId(),info,data) #define RIVER_CRITICAL(data) RIVER_BASE(1, data) #define RIVER_ERROR(data) RIVER_BASE(2, data) diff --git a/test/debug.h b/test/debug.h index 2b07d37..bf87220 100644 --- a/test/debug.h +++ b/test/debug.h @@ -14,16 +14,7 @@ namespace appl { int32_t getLogId(); }; -// TODO : Review this problem of multiple intanciation of "std::stringbuf sb" -#define APPL_BASE(info,data) \ - do { \ - if (info <= etk::log::getLevel(appl::getLogId())) { \ - std::stringbuf sb; \ - std::ostream tmpStream(&sb); \ - tmpStream << data; \ - etk::log::logStream(appl::getLogId(), info, __LINE__, __class__, __func__, tmpStream); \ - } \ - } while(0) +#define APPL_BASE(info,data) TK_LOG_BASE(appl::getLogId(),info,data) #define APPL_CRITICAL(data) APPL_BASE(1, data) #define APPL_ERROR(data) APPL_BASE(2, data) diff --git a/test/main.cpp b/test/main.cpp index f69df65..f92c4d8 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -28,77 +28,20 @@ #undef __class__ #define __class__ "test" - - - - -/* -static void threadVolume() { - std11::shared_ptr manager; - manager = river::Manager::create("testApplication"); - std11::shared_ptr process = std11::make_shared(manager); - usleep(100000); - process->run(); - process.reset(); - usleep(500000); -} - -TEST(TestALL, testInputCallBackMicClean) { - std11::shared_ptr manager; - manager = river::Manager::create("testApplication"); - - std11::thread tmpThread(std11::bind(&threadVolume)); - usleep(30000); - APPL_INFO("test input (callback mode)"); - std11::shared_ptr process = std11::make_shared(manager, "microphone-clean"); - process->run(); - - usleep(100000); - process.reset(); - usleep(500000); - tmpThread.join(); -} -*/ - - int main(int argc, char **argv) { // init Google test : ::testing::InitGoogleTest(&argc, const_cast(argv)); // the only one init for etk: - etk::log::setLevel(etk::log::logLevelNone); - for (int32_t iii=0; iii