summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGENIVI Audio Manager Maintainer <GeniviAMmaintainer@users.noreply.github.com>2016-12-13 17:05:17 +0100
committerGitHub <noreply@github.com>2016-12-13 17:05:17 +0100
commitfe056279dde92475f29a35f8c0c6c5a41dc59a8b (patch)
treefc69eb263c565a8eec891350766d579965a5baf8
parentbf7cb462c12e42cffc78560499ddd06a9a05b01d (diff)
parent3cec2f355765ec225ef5f8c228f7d00720582e52 (diff)
downloadaudiomanager-fe056279dde92475f29a35f8c0c6c5a41dc59a8b.tar.gz
Merge pull request #10 from JensLorenz/dlt_is_loglevel_enable
AMUtil: New check log level support of DLT added.
-rw-r--r--AudioManagerUtilities/CMakeLists.txt10
-rw-r--r--AudioManagerUtilities/include/CAmDltWrapper.h12
2 files changed, 22 insertions, 0 deletions
diff --git a/AudioManagerUtilities/CMakeLists.txt b/AudioManagerUtilities/CMakeLists.txt
index 6e9a06f..5933e4b 100644
--- a/AudioManagerUtilities/CMakeLists.txt
+++ b/AudioManagerUtilities/CMakeLists.txt
@@ -109,6 +109,16 @@ IF (WITH_DLT)
add_definitions(${DLT_CFLAGS_OTHER})
+ set (DLT_VERSIONING ${DLT_VERSION})
+ string (REPLACE "." ";" DLT_VERSIONING ${DLT_VERSIONING})
+ list (LENGTH DLT_VERSIONING size)
+
+ if (size GREATER "1")
+ list (GET DLT_VERSIONING 0 DLT_MAJOR_VERSION)
+ list (GET DLT_VERSIONING 1 DLT_MINOR_VERSION)
+ add_definitions (-DDLT_MAJOR_VERSION=${DLT_MAJOR_VERSION} -DDLT_MINOR_VERSION=${DLT_MINOR_VERSION})
+ endif (size GREATER "1")
+
set(AUDIO_MANAGER_UTILITIES_LIBS
${AUDIO_MANAGER_UTILITIES_LIBS}
${DLT_LIBRARIES}
diff --git a/AudioManagerUtilities/include/CAmDltWrapper.h b/AudioManagerUtilities/include/CAmDltWrapper.h
index 8c2b514..a37ec77 100644
--- a/AudioManagerUtilities/include/CAmDltWrapper.h
+++ b/AudioManagerUtilities/include/CAmDltWrapper.h
@@ -158,6 +158,18 @@ public:
bool init(DltLogLevelType loglevel, DltContext* context = NULL);
+ bool checkLogLevel(DltLogLevelType logLevel)
+ {
+#ifdef WITH_DLT
+ #if (DLT_MAJOR_VERSION >= 2 && DLT_MINOR_VERSION >= 16)
+ return (1 == dlt_user_is_logLevel_enabled(&mDltContext,logLevel)? true: false);
+ #else
+ return false;
+ #endif
+#else
+ return (logLevel <= mDltContext.log_level_user);
+#endif
+ }
void deinit();
void send();
void append(const int8_t value);