140 I_ASSIGN(m_logCompPtr,
"Log",
"Consumer log messages",
false,
"Log");
141 I_ASSIGN(m_verboseEnabledAttrPtr,
"EnableVerbose",
"If enabled, verbose messages can be produced",
true,
false);
142 I_ASSIGN(m_tracingConfigurationCompPtr,
"TracingConfiguration",
"If enabled, verbose messages can be produced with tracing level",
false,
"TracingConfiguration");
143 I_ASSIGN(m_showComponentIdAttrPtr,
"ShowComponentId",
"If enabled the component ID will be shown as a part of the message source",
true,
true);
195 void SendVerboseMessage(
const QString& message,
const QString& messageSource = QString(),
int tracingLevel = 0)
const;
231 QString& messageSource)
const override;
267 I_ATTR(
bool, m_verboseEnabledAttrPtr);
269 I_ATTR(
bool, m_showComponentIdAttrPtr);
280 bool retVal = *m_verboseEnabledAttrPtr;;
282 if (m_tracingConfigurationCompPtr.IsValid()){
283 retVal = m_tracingConfigurationCompPtr->GetTracingLevel() >= tracingLevel;
286 retVal = retVal && BaseClass2::IsLogConsumed(&categoryNone);
295 if (IsVerboseEnabled(tracingLevel)){
309 QString& messageSource)
const
311 BaseClass2::DecorateMessage(category,
id, flags, message, messageSource);
313 if (*m_showComponentIdAttrPtr){
315 if (contextPtr !=
NULL){
316 if (messageSource.isEmpty()){
320 messageSource = QString(contextPtr->
GetContextId()) +
" (" + messageSource +
")";
332 if (m_logCompPtr.IsValid()){
333 this->SetLogPtr(m_logCompPtr.GetPtr());
336 BaseClass::OnComponentCreated();
343 this->SetLogPtr(
NULL);
345 BaseClass::OnComponentDestroyed();
Provide session context of component.
virtual const QByteArray & GetContextId() const =0
Get ID of this component in the context tree.
Base class for objects that need logging functionality.
Common interface for a message container consuming information objects (messages).
Interface for configuring tracing verbosity levels.
Template wrapper adding comprehensive logging functionality to components.
ilog::CLoggerBase BaseClass2
Base class typedef for logger functionality.
bool IsVerboseEnabled(int tracingLevel=0) const
Check if verbose messages are enabled for a given tracing level.
virtual void OnComponentCreated() override
Called when component is created.
virtual void DecorateMessage(istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const override
Decorate message before sending.
virtual void OnComponentDestroyed() override
Called when component is destroyed.
void SendVerboseMessage(const QString &message, const QString &messageSource=QString(), int tracingLevel=0) const
Send a verbose message if enabled.
Base BaseClass
Base class typedef for component functionality.
TLoggerCompWrap< icomp::CComponentBase > CLoggerComponentBase
Convenience typedef for simple components with logging.
This namespace contains implementations for the logging functionality.