summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koch <mkoch@de.adit-jv.com>2020-01-14 14:48:54 +0100
committerMartin Koch <mkoch@de.adit-jv.com>2020-01-14 15:27:26 +0100
commit56b7b1883c354b78ab6cff5739ddd2f170603324 (patch)
tree6f95ae6a3cc298633b9af7e5a7d3febbba5dbd35
parente0c47ec1fd95abbc5f8f32f9d9968dfbd02b0999 (diff)
downloadaudiomanager-56b7b1883c354b78ab6cff5739ddd2f170603324.tar.gz
AM: Reorganize daemon, core, utilities and tests to make use of the new logging architecture.
- Known side-effect: CAmSerializer.h and TAmPluginTemplate.h no longer indirectly include dlt_user.h. Thus macros like DLT_DECLARE_CONTEXT and DLT_IMPORT_CONTEXT may be undefined in application code unless CAmDltWrapper.h or dlt_user.h is included explicitly. - Since the DLT functionality is now encapsulated inside a dedicated class, such declaration is usually superfluous and can be dropped. Signed-off-by: Martin Koch <mkoch@de.adit-jv.com>
-rw-r--r--AudioManagerCore/src/CAmCommandReceiver.cpp2
-rw-r--r--AudioManagerCore/src/CAmCommandSender.cpp2
-rw-r--r--AudioManagerCore/src/CAmControlReceiver.cpp2
-rw-r--r--AudioManagerCore/src/CAmControlSender.cpp2
-rw-r--r--AudioManagerCore/src/CAmDatabaseHandlerMap.cpp2
-rw-r--r--AudioManagerCore/src/CAmRouter.cpp2
-rw-r--r--AudioManagerCore/src/CAmRoutingReceiver.cpp2
-rw-r--r--AudioManagerCore/src/CAmRoutingSender.cpp2
-rw-r--r--AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp7
-rw-r--r--AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.h1
-rw-r--r--AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp5
-rw-r--r--AudioManagerCore/test/AmRouterMapTest/CAmRouterMapTest.cpp5
-rw-r--r--AudioManagerCore/test/AmRouterTest/CAmRouterTest.cpp5
-rw-r--r--AudioManagerCore/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp5
-rw-r--r--AudioManagerDaemon/src/main.cpp6
-rw-r--r--AudioManagerUtilities/include/CAmSerializer.h2
-rw-r--r--AudioManagerUtilities/include/TAmPluginTemplate.h2
-rw-r--r--AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp2
-rw-r--r--AudioManagerUtilities/src/CAmDbusWrapper.cpp2
-rw-r--r--AudioManagerUtilities/src/CAmSocketHandler.cpp2
-rw-r--r--AudioManagerUtilities/src/CAmWatchdog.cpp2
-rw-r--r--AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp3
22 files changed, 35 insertions, 30 deletions
diff --git a/AudioManagerCore/src/CAmCommandReceiver.cpp b/AudioManagerCore/src/CAmCommandReceiver.cpp
index 78d8cbe..b310bf3 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 d1a4a22..cde2315 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 6fec509..be64706 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 1baeb30..a68f2b0 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 c79fbf3..12bb001 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();
}
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index 1567265..dc4bae0 100644
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -55,7 +55,7 @@
#include "CAmRoutingReceiver.h"
#include "CAmCommandReceiver.h"
#include "CAmControlReceiver.h"
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
#include "CAmSocketHandler.h"
#include "CAmCommandLineSingleton.h"
#include "CAmDatabaseHandlerMap.h"
@@ -244,7 +244,9 @@ void mainProgram(int argc, char *argv[])
daemonize();
}
- CAmDltWrapper::instanctiateOnce(AUDIOMANGER_APP_ID, AUDIOMANGER_APP_DESCRIPTION, dltEnable.getValue(), static_cast<am::CAmDltWrapper::logDestination>(dltOutput.getValue()), dltLogFilename.getValue());
+ CAmLogWrapper::instantiateOnce(AUDIOMANGER_APP_ID, AUDIOMANGER_APP_DESCRIPTION
+ , dltEnable.getValue() ? LS_ON : LS_OFF, static_cast<am::am_LogService_e>(dltOutput.getValue())
+ , dltLogFilename.getValue());
// Instantiate all classes. Keep in same order !
CAmSocketHandler iSocketHandler;
diff --git a/AudioManagerUtilities/include/CAmSerializer.h b/AudioManagerUtilities/include/CAmSerializer.h
index 5fd1977..1c86942 100644
--- a/AudioManagerUtilities/include/CAmSerializer.h
+++ b/AudioManagerUtilities/include/CAmSerializer.h
@@ -23,7 +23,7 @@
#include <memory>
#include <stdexcept>
#include <unistd.h>
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
#include "CAmSocketHandler.h"
/*!
diff --git a/AudioManagerUtilities/include/TAmPluginTemplate.h b/AudioManagerUtilities/include/TAmPluginTemplate.h
index b030123..f386cc2 100644
--- a/AudioManagerUtilities/include/TAmPluginTemplate.h
+++ b/AudioManagerUtilities/include/TAmPluginTemplate.h
@@ -26,7 +26,7 @@
#include <dlfcn.h>
#include <libgen.h>
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
namespace am
{
diff --git a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
index e22dcd6..d110293 100644
--- a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
@@ -27,7 +27,7 @@
#include <vector>
#include "audiomanagertypes.h"
#include "CAmSocketHandler.h"
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
#include "CAmCommonAPIWrapper.h"
namespace am
diff --git a/AudioManagerUtilities/src/CAmDbusWrapper.cpp b/AudioManagerUtilities/src/CAmDbusWrapper.cpp
index 504bf38..99a4eb2 100644
--- a/AudioManagerUtilities/src/CAmDbusWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmDbusWrapper.cpp
@@ -29,7 +29,7 @@
#include <cassert>
#include <cstdlib>
#include <stdexcept>
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
#include "CAmSocketHandler.h"
namespace am
diff --git a/AudioManagerUtilities/src/CAmSocketHandler.cpp b/AudioManagerUtilities/src/CAmSocketHandler.cpp
index 8f0cdb0..d657c7c 100644
--- a/AudioManagerUtilities/src/CAmSocketHandler.cpp
+++ b/AudioManagerUtilities/src/CAmSocketHandler.cpp
@@ -33,7 +33,7 @@
#include <csignal>
#include <cstring>
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
#include "CAmSocketHandler.h"
#ifdef WITH_TIMERFD
diff --git a/AudioManagerUtilities/src/CAmWatchdog.cpp b/AudioManagerUtilities/src/CAmWatchdog.cpp
index 3bac79c..5c64713 100644
--- a/AudioManagerUtilities/src/CAmWatchdog.cpp
+++ b/AudioManagerUtilities/src/CAmWatchdog.cpp
@@ -26,7 +26,7 @@
#include <cstdlib>
#include <stdexcept>
#include "audiomanagerconfig.h"
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
#include <systemd/sd-daemon.h>
namespace am
diff --git a/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp b/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
index 3fde011..9914955 100644
--- a/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
+++ b/AudioManagerUtilities/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp
@@ -32,7 +32,7 @@
#include <sys/un.h>
#include <sys/poll.h>
#include <sys/eventfd.h>
-#include "CAmDltWrapper.h"
+#include "CAmLogWrapper.h"
#include "CAmSocketHandler.h"
@@ -771,6 +771,7 @@ TEST(CAmSocketHandlerTest,playWithSockets)
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
+ CAmLogWrapper::instantiateOnce("GTST", "GTEST for Socket Handler", LS_ON, LOG_SERVICE_DLT);
return RUN_ALL_TESTS();
}