diff options
author | sebastien baudouin <sebastien.baudouin@windriver.com> | 2015-03-17 16:58:05 +0100 |
---|---|---|
committer | root <sebastien.baudouin@windriver.com> | 2015-04-01 10:03:57 +0200 |
commit | 3955d0dd4a544577f812854ef333ddb80dbc177f (patch) | |
tree | b388d6c9780adc99a7abfaa8ce91a3d8499ff2b6 /app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp | |
parent | d381c04defc530aff90977012895b48adf104f5f (diff) | |
download | genivi-demo-platform-hmi-3955d0dd4a544577f812854ef333ddb80dbc177f.tar.gz |
gdp-hmi-launcher2: Add DLT support for launcher2baserock/jonathanmaw/genivi-demo-jetson
This commit enable under flag usage of DLT GENIVI Log and Trace tool. User needs
to define USE_DLT flag for enabling output of traces using DLT tool and
infrastructure.
Diffstat (limited to 'app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp')
-rw-r--r-- | app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp index b626f9b..84bccff 100644 --- a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp +++ b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp @@ -25,7 +25,12 @@ #include <errno.h> #include <fcntl.h> #include <unistd.h> +#ifdef USE_DLT +#include <dlt/dlt.h> +DLT_IMPORT_CONTEXT(launcherTraceCtx); +#else #include <systemd/sd-journal.h> +#endif #include "gdp-hmi-launcher2.h" @@ -36,7 +41,11 @@ static const char *GDP_DBUS_SERVICE_PATH = "/org/genivi/gdp/hmi/controller"; GDPLauncherClass::GDPLauncherClass() : m_hmiControllerPid(-1) { +#ifdef USE_DLT + DLT_LOG(launcherTraceCtx,DLT_LOG_INFO,DLT_STRING("Debug: GDPLauncherClass - dbus session.\n")); +#else sd_journal_print(LOG_DEBUG, "Debug: GDPLauncherClass - dbus session.\n"); +#endif m_controller = new org::genivi::gdp::HMI_Controller(GDP_DBUS_SERVICE_NAME, GDP_DBUS_SERVICE_PATH, QDBusConnection::sessionBus(), this); m_timerId = startTimer(5000); // 5 second timer @@ -50,6 +59,10 @@ void GDPLauncherClass::timerEvent(QTimerEvent *event) { Q_UNUSED(event); if ( !(m_controller->isValid()) ) { +#ifdef USE_DLT + DLT_LOG(launcherTraceCtx,DLT_LOG_INFO,DLT_STRING("Info: HMI Controller - disconnected.\n")); +#else sd_journal_print(LOG_INFO, "Info: HMI Controller - disconnected.\n"); +#endif } } |