diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CommonAPI/Logger.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/CommonAPI/Logger.cpp b/src/CommonAPI/Logger.cpp index 9527431..81b93f2 100644 --- a/src/CommonAPI/Logger.cpp +++ b/src/CommonAPI/Logger.cpp @@ -32,17 +32,23 @@ Logger::Level Logger::maximumLogLevel_(Logger::Level::LL_INFO); Logger::Logger() { #ifdef USE_DLT - DLT_REGISTER_APP("CAPI", "CAPI"); - std::string context = Runtime::getProperty("LogContext"); - if (context == "") context = "CAPI"; - DLT_REGISTER_CONTEXT(dlt_, context.c_str(), "CAPI"); + 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"); + } #endif } Logger::~Logger() { #ifdef USE_DLT - DLT_UNREGISTER_CONTEXT(dlt_); - DLT_UNREGISTER_APP(); + if (useDlt_) { + DLT_UNREGISTER_CONTEXT(dlt_); + DLT_UNREGISTER_APP(); + } #endif } |