diff options
Diffstat (limited to 'src/geniviextras/qdltregistration.cpp')
-rw-r--r-- | src/geniviextras/qdltregistration.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/geniviextras/qdltregistration.cpp b/src/geniviextras/qdltregistration.cpp index bef94d1..4ba638a 100644 --- a/src/geniviextras/qdltregistration.cpp +++ b/src/geniviextras/qdltregistration.cpp @@ -151,6 +151,16 @@ void QDltRegistrationPrivate::registerCategory(CategoryInfo &info) info.m_registered = true; } +void QDltRegistrationPrivate::unregisterCategories() +{ + for (auto it = m_categoryInfoHash.begin(); it != m_categoryInfoHash.end(); ++it) { + if (it.value().m_registered) { + DLT_UNREGISTER_CONTEXT(*it.value().m_context); + it.value().m_registered = false; + } + } +} + void QDltRegistrationPrivate::registerApplication() { Q_ASSERT_X(!m_dltAppID.isEmpty(), "registerApplication", "dltAppID needs to be a valid char * on the first call."); @@ -431,7 +441,7 @@ void QDltRegistration::registerUnregisteredContexts() for (auto it = d->m_categoryInfoHash.begin(); it != d->m_categoryInfoHash.end(); ++it) { if (!it.value().m_registered) { d->registerCategory(it.value()); - } + } } } @@ -459,6 +469,20 @@ void QDltRegistration::unregisterApplication() } /*! + Unregisters all categories and their associated context Ids from the dlt-daemon. + + One application of this function could be to update the log level: after this function has been + called, all cetegories will be registered again (with new log level), when they are used next + time. +*/ +void QDltRegistration::unregisterCategories() +{ + Q_D(QDltRegistration); + QMutexLocker l(&d->m_mutex); + d->unregisterCategories(); +} + +/*! The Qt message handler which forwards all the logging messages to the dlt-daemon. The function will map \a msgTypes to the appropriate dlt log level and forward the \a msg to |