diff options
author | Martin Koch <51775589+mkoch-aditg@users.noreply.github.com> | 2020-02-10 08:08:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 08:08:28 +0100 |
commit | ce23c6757e083040ce05c1ad758ba25caf98b44f (patch) | |
tree | 20c36aab9ca43ad651565bec2e7c8db6eee92a2b /AudioManagerCore | |
parent | 86963abab32af54f7fe1244a727d3340ddeb5450 (diff) | |
parent | 56b7b1883c354b78ab6cff5739ddd2f170603324 (diff) | |
download | audiomanager-ce23c6757e083040ce05c1ad758ba25caf98b44f.tar.gz |
Merge pull request #48 from GENIVI/LoggingArchitecture
AM-Utils: Introduce new logging architecture, providing a common DLT-independant wrapper for the 3 logging channels (DLT, file and stdout)
Diffstat (limited to 'AudioManagerCore')
14 files changed, 23 insertions, 21 deletions
diff --git a/AudioManagerCore/src/CAmCommandReceiver.cpp b/AudioManagerCore/src/CAmCommandReceiver.cpp index 028b6ef..19c3bac 100644 --- a/AudioManagerCore/src/CAmCommandReceiver.cpp +++ b/AudioManagerCore/src/CAmCommandReceiver.cpp @@ -26,7 +26,7 @@ #include <algorithm> #include "IAmDatabaseHandler.h" #include "CAmControlSender.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmSocketHandler.h" #define __METHOD_NAME__ std::string(std::string("CAmCommandReceiver::") + __func__) diff --git a/AudioManagerCore/src/CAmCommandSender.cpp b/AudioManagerCore/src/CAmCommandSender.cpp index fd1be69..2240ae5 100644 --- a/AudioManagerCore/src/CAmCommandSender.cpp +++ b/AudioManagerCore/src/CAmCommandSender.cpp @@ -32,7 +32,7 @@ #include <stdexcept> #include "CAmCommandReceiver.h" #include "TAmPluginTemplate.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "audiomanagerconfig.h" #define __METHOD_NAME__ std::string(std::string("CAmCommandSender::") + __func__) diff --git a/AudioManagerCore/src/CAmControlReceiver.cpp b/AudioManagerCore/src/CAmControlReceiver.cpp index c72d733..c88f413 100644 --- a/AudioManagerCore/src/CAmControlReceiver.cpp +++ b/AudioManagerCore/src/CAmControlReceiver.cpp @@ -30,7 +30,7 @@ #include "CAmRoutingSender.h" #include "CAmCommandSender.h" #include "CAmRouter.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmSocketHandler.h" namespace am { diff --git a/AudioManagerCore/src/CAmControlSender.cpp b/AudioManagerCore/src/CAmControlSender.cpp index a683a42..0fa84ef 100644 --- a/AudioManagerCore/src/CAmControlSender.cpp +++ b/AudioManagerCore/src/CAmControlSender.cpp @@ -32,7 +32,7 @@ #include <sys/types.h> #include <dirent.h> #include "TAmPluginTemplate.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" namespace am { diff --git a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp index 928ce8f..55e92de 100644 --- a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp +++ b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp @@ -31,7 +31,7 @@ #include <limits> #include "CAmDatabaseHandlerMap.h" #include "CAmRouter.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" static std::string __am_className__("CAmDatabaseHandlerMap::"); #define __METHOD_NAME__ std::string(__am_className__ + __func__) diff --git a/AudioManagerCore/src/CAmRouter.cpp b/AudioManagerCore/src/CAmRouter.cpp index 042916d..65ca27f 100644 --- a/AudioManagerCore/src/CAmRouter.cpp +++ b/AudioManagerCore/src/CAmRouter.cpp @@ -29,7 +29,7 @@ #include "CAmRouter.h" #include "IAmDatabaseHandler.h" #include "CAmControlSender.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" namespace am { diff --git a/AudioManagerCore/src/CAmRoutingReceiver.cpp b/AudioManagerCore/src/CAmRoutingReceiver.cpp index f372df9..be13474 100644 --- a/AudioManagerCore/src/CAmRoutingReceiver.cpp +++ b/AudioManagerCore/src/CAmRoutingReceiver.cpp @@ -27,7 +27,7 @@ #include "IAmDatabaseHandler.h" #include "CAmRoutingSender.h" #include "CAmControlSender.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmSocketHandler.h" #define __METHOD_NAME__ std::string(std::string("CAmRoutingReceiver::") + __func__) diff --git a/AudioManagerCore/src/CAmRoutingSender.cpp b/AudioManagerCore/src/CAmRoutingSender.cpp index cb66fe9..36f5c1a 100644 --- a/AudioManagerCore/src/CAmRoutingSender.cpp +++ b/AudioManagerCore/src/CAmRoutingSender.cpp @@ -34,7 +34,7 @@ #include <stdexcept> #include "CAmRoutingReceiver.h" #include "TAmPluginTemplate.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "IAmDatabaseHandler.h" namespace am diff --git a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp index 27ed2b6..4f2c16a 100644 --- a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp +++ b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp @@ -25,13 +25,12 @@ #include <string> #include <vector> #include <set> -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmCommandLineSingleton.h" using namespace am; using namespace testing; -DLT_DECLARE_CONTEXT(AudioManager) TCLAP::SwitchArg enableDebug ("V","logDlt","print DLT logs to stdout or dlt-daemon default on",true); ACTION(returnResyncConnection) @@ -71,7 +70,6 @@ CAmControlInterfaceTest::CAmControlInterfaceTest() : CAmControlInterfaceTest::~CAmControlInterfaceTest() { - CAmDltWrapper::instance()->unregisterContext(AudioManager); } void CAmControlInterfaceTest::SetUp() @@ -663,7 +661,8 @@ int main(int argc, char **argv) catch (TCLAP::ArgException &e) // catch any exceptions { std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; } CAmCommandLineSingleton::instance()->preparse(argc,argv); - CAmDltWrapper::instanctiateOnce("ATEST","AudioManagerControlInterface Test",enableDebug.getValue(),CAmDltWrapper::logDestination::DAEMON); + CAmLogWrapper::instantiateOnce("ATEST","AudioManagerControlInterface Test" + ,enableDebug.getValue() ? LS_ON : LS_OFF, LOG_SERVICE_DLT); logInfo("RoutingSendInterface Test started"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.h b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.h index 9ebcec7..490f7c2 100644 --- a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.h +++ b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.h @@ -40,7 +40,6 @@ #include "../MockIAmControlSend.h" #include "CAmSocketHandler.h" -DLT_DECLARE_CONTEXT(textContext) namespace am { diff --git a/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp b/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp index 1872aeb..6e10d19 100644 --- a/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp +++ b/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp @@ -27,7 +27,7 @@ #include <vector> #include <set> #include <ios> -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmCommandLineSingleton.h" using namespace am; @@ -3550,7 +3550,8 @@ int main(int argc, char **argv) catch (TCLAP::ArgException &e) // catch any exceptions { std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; } CAmCommandLineSingleton::instance()->preparse(argc,argv); - CAmDltWrapper::instanctiateOnce("DTEST","Database Test",enableDebug.getValue(),CAmDltWrapper::logDestination::DAEMON); + CAmLogWrapper::instantiateOnce("DTEST","Database Test" + ,enableDebug.getValue() ? LS_ON : LS_OFF, LOG_SERVICE_DLT); logInfo("Database Test started "); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/AudioManagerCore/test/AmRouterMapTest/CAmRouterMapTest.cpp b/AudioManagerCore/test/AmRouterMapTest/CAmRouterMapTest.cpp index 11d8c3c..295b017 100644 --- a/AudioManagerCore/test/AmRouterMapTest/CAmRouterMapTest.cpp +++ b/AudioManagerCore/test/AmRouterMapTest/CAmRouterMapTest.cpp @@ -24,7 +24,7 @@ #include <chrono> #include "CAmRouterMapTest.h" #include <string.h> -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmCommandLineSingleton.h" TCLAP::SwitchArg enableDebug("V", "logDlt", "print DLT logs to stdout or dlt-daemon default off", false); @@ -3774,7 +3774,8 @@ int main(int argc, char **argv) std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; } CAmCommandLineSingleton::instance()->preparse(argc, argv); - CAmDltWrapper::instanctiateOnce("rTEST", "RouterMap Test", enableDebug.getValue(), CAmDltWrapper::logDestination::DAEMON); + CAmLogWrapper::instantiateOnce("rTEST", "RouterMap Test" + , enableDebug.getValue() ? LS_ON : LS_OFF, LOG_SERVICE_DLT); logInfo("Routing Test started "); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/AudioManagerCore/test/AmRouterTest/CAmRouterTest.cpp b/AudioManagerCore/test/AmRouterTest/CAmRouterTest.cpp index ea1f452..604d15a 100644 --- a/AudioManagerCore/test/AmRouterTest/CAmRouterTest.cpp +++ b/AudioManagerCore/test/AmRouterTest/CAmRouterTest.cpp @@ -22,7 +22,7 @@ #include "CAmRouterTest.h" #include <string.h> -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmCommandLineSingleton.h" using namespace am; @@ -1974,7 +1974,8 @@ int main(int argc, char **argv) catch (TCLAP::ArgException &e) // catch any exceptions { std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; } CAmCommandLineSingleton::instance()->preparse(argc,argv); - CAmDltWrapper::instanctiateOnce("RTEST","Router Test",enableDebug.getValue(),CAmDltWrapper::logDestination::DAEMON); + CAmLogWrapper::instantiateOnce("RTEST","Router Test" + ,enableDebug.getValue() ? LS_ON : LS_OFF, LOG_SERVICE_DLT); logInfo("Routing Test started "); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/AudioManagerCore/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp b/AudioManagerCore/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp index 3a576e6..e5e9636 100644 --- a/AudioManagerCore/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp +++ b/AudioManagerCore/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp @@ -21,7 +21,7 @@ */ #include "CAmRoutingInterfaceTest.h" -#include "CAmDltWrapper.h" +#include "CAmLogWrapper.h" #include "CAmCommandLineSingleton.h" using namespace am; @@ -655,7 +655,8 @@ int main(int argc, char **argv) catch (TCLAP::ArgException &e) // catch any exceptions { std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; } CAmCommandLineSingleton::instance()->preparse(argc,argv); - CAmDltWrapper::instanctiateOnce("RTEST","RoutingInterface Test",enableDebug.getValue(),CAmDltWrapper::logDestination::COMMAND_LINE); + CAmLogWrapper::instantiateOnce("RTEST","RoutingInterface Test" + , enableDebug.getValue() ? LS_ON : LS_OFF, LOG_SERVICE_STDOUT); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } |