summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Huss <dirk_huss@mentor.com>2016-04-08 10:41:00 +0200
committerDirk Huss <dirk_huss@mentor.com>2016-04-08 10:41:00 +0200
commit1c158272e2ee4b93021a97ac3b5c207a137b0d2c (patch)
treeb27d937fad635fde5a43f40300b4737e6ad30f98
parent9345fac016a33c61175e4a06675c20d8590dc201 (diff)
downloadgenivi-common-api-runtime-1c158272e2ee4b93021a97ac3b5c207a137b0d2c.tar.gz
CommonAPI 3.1.7.1
-rw-r--r--include/CommonAPI/Logger.hpp1
-rw-r--r--src/CommonAPI/IniFileReader.cpp2
-rw-r--r--src/CommonAPI/Logger.cpp15
3 files changed, 12 insertions, 6 deletions
diff --git a/include/CommonAPI/Logger.hpp b/include/CommonAPI/Logger.hpp
index 71c4d23..52a55bf 100644
--- a/include/CommonAPI/Logger.hpp
+++ b/include/CommonAPI/Logger.hpp
@@ -185,6 +185,7 @@ private:
#ifdef USE_DLT
static bool useDlt_;
DLT_DECLARE_CONTEXT(dlt_);
+ bool ownAppID_;
#endif
};
diff --git a/src/CommonAPI/IniFileReader.cpp b/src/CommonAPI/IniFileReader.cpp
index b1c96f1..fd8adf8 100644
--- a/src/CommonAPI/IniFileReader.cpp
+++ b/src/CommonAPI/IniFileReader.cpp
@@ -30,7 +30,7 @@ bool
IniFileReader::load(const std::string &_path) {
std::ifstream configStream(_path);
if (configStream.is_open()) {
- COMMONAPI_INFO("Loading ini file from ", _path);
+ //COMMONAPI_INFO("Loading ini file from ", _path);
int lineCounter(0);
std::string currentSectionName;
diff --git a/src/CommonAPI/Logger.cpp b/src/CommonAPI/Logger.cpp
index 81b93f2..0de6c9a 100644
--- a/src/CommonAPI/Logger.cpp
+++ b/src/CommonAPI/Logger.cpp
@@ -33,12 +33,15 @@ Logger::Level Logger::maximumLogLevel_(Logger::Level::LL_INFO);
Logger::Logger() {
#ifdef USE_DLT
if (useDlt_) {
- std::string app = Runtime::getProperty("LogApplication");
- if (app == "") app = "CAPI";
- DLT_REGISTER_APP(app.c_str(), "CAPI");
std::string context = Runtime::getProperty("LogContext");
if (context == "") context = "CAPI";
- DLT_REGISTER_CONTEXT(dlt_, context.c_str(), "CAPI");
+ if (DLT_RETURN_ERROR == dlt_register_context(&dlt_, context.c_str(), "CAPI")) {
+ std::string app = Runtime::getProperty("LogApplication");
+ if (app == "") app = "CAPI";
+ ownAppID_ = true;
+ DLT_REGISTER_APP(app.c_str(), "CAPI");
+ DLT_REGISTER_CONTEXT(dlt_, context.c_str(), "CAPI");
+ }
}
#endif
}
@@ -47,7 +50,9 @@ Logger::~Logger() {
#ifdef USE_DLT
if (useDlt_) {
DLT_UNREGISTER_CONTEXT(dlt_);
- DLT_UNREGISTER_APP();
+ if (ownAppID_) {
+ DLT_UNREGISTER_APP();
+ }
}
#endif
}