From 278c08ffaff6de6155bffa80cd5a25ac0807b745 Mon Sep 17 00:00:00 2001 From: christian mueller Date: Tue, 26 Jun 2012 19:32:28 +0200 Subject: * [GAM-55] some finetuning on bugfix. * fixing registration of Dltcontextx too late for Dbus plugins Signed-off-by: christian mueller --- AudioManagerDaemon/src/CAmDltWrapper.cpp | 11 ++++++++--- AudioManagerDaemon/src/main.cpp | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'AudioManagerDaemon') diff --git a/AudioManagerDaemon/src/CAmDltWrapper.cpp b/AudioManagerDaemon/src/CAmDltWrapper.cpp index aa7e423..51ab7ce 100644 --- a/AudioManagerDaemon/src/CAmDltWrapper.cpp +++ b/AudioManagerDaemon/src/CAmDltWrapper.cpp @@ -61,7 +61,7 @@ CAmDltWrapper::CAmDltWrapper(const bool enableNoDLTDebug) : { (void) enableNoDLTDebug; #ifndef WITH_DLT - std::cout << "[DLT] Running without DLT-support" << std::endl; + std::cout << "\e[0;34m[DLT]\e[0;30m\tRunning without DLT-support" << std::endl; #endif } @@ -82,7 +82,7 @@ void CAmDltWrapper::registerContext(DltContext& handle, const char *contextid, c #ifdef WITH_DLT dlt_register_context(&handle, contextid, description); #else - (void) handle; + strncpy(handle.contextID,contextid,4); // store only the first contextID if(0 == strlen(mDltContext.contextID)) @@ -96,6 +96,8 @@ void CAmDltWrapper::registerContext(DltContext& handle, const char *contextid, c } } + std::cout << "\e[0;34m[DLT]\e[0;30m\tRegistering Context " << contextid << " , " << description << std::endl; + #endif } @@ -107,6 +109,9 @@ void CAmDltWrapper::init(DltLogLevelType loglevel, DltContext* context) context = &mDltContext; #ifdef WITH_DLT dlt_user_log_write_start(context, &mDltContextData, loglevel); +#else + if(mEnableNoDLTDebug) + std::cout << "\e[0;34m[" << context->contextID << "]\e[0;30m\t"; #endif } @@ -117,7 +122,7 @@ void CAmDltWrapper::send() dlt_user_log_write_finish(&mDltContextData); #else if(mEnableNoDLTDebug) - std::cout << "[" << mDltContext.contextID << "] " << mDltContextData.buffer.str().c_str() << std::endl; + std::cout << mDltContextData.buffer.str().c_str() << std::endl; mDltContextData.buffer.str(""); mDltContextData.buffer.clear(); diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp index de2a91a..b9eade1 100755 --- a/AudioManagerDaemon/src/main.cpp +++ b/AudioManagerDaemon/src/main.cpp @@ -235,7 +235,7 @@ void parseCommandLine(int argc, char **argv) break; #ifndef WITH_DLT case 'V': - printf("[DLT] debug output to stdout enabled\n"); + printf("\e[0;34m[DLT]\e[0;30m\tDebug output to stdout enabled\n"); enableNoDLTDebug = true; break; #endif -- cgit v1.2.1