|
ACF $AcfVersion:0$
|
Template wrapper adding comprehensive logging functionality to components. More...
#include <TLoggerCompWrap.h>
Public Types | |
| typedef Base | BaseClass |
| Base class typedef for component functionality. | |
| typedef ilog::CLoggerBase | BaseClass2 |
| Base class typedef for logger functionality. | |
Protected Member Functions | |
| bool | IsVerboseEnabled (int tracingLevel=0) const |
| Check if verbose messages are enabled for a given tracing level. | |
| void | SendVerboseMessage (const QString &message, const QString &messageSource=QString(), int tracingLevel=0) const |
| Send a verbose message if enabled. | |
| virtual void | DecorateMessage (istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const override |
| Decorate message before sending. | |
| virtual void | OnComponentCreated () override |
| Called when component is created. | |
| virtual void | OnComponentDestroyed () override |
| Called when component is destroyed. | |
Protected Member Functions inherited from ilog::CLoggerBase | |
| bool | SendInfoMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send info message to log. | |
| bool | SendWarningMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send warning message to log. | |
| bool | SendErrorMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send error message to log. | |
| bool | SendCriticalMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send critical message to log. | |
| bool | SendInfoMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once info message to log. | |
| bool | SendWarningMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once warning message to log. | |
| bool | SendErrorMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once error message to log. | |
| bool | SendCriticalMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once critical message to log. | |
| bool | SendUserMessage (const istd::IInformationProvider *messagePtr) const |
| Send message with user object. | |
| bool | AllowMessageOnceAgain (int id) |
| Reset message lock. | |
| virtual bool | IsLogConsumed (const istd::IInformationProvider::InformationCategory *categoryPtr=NULL, const int *flagsPtr=NULL) const override |
| Check if any log message is consumed. | |
| virtual bool | SendLogMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &message, const QString &messageSource, int flags=0) const override |
| Send any message to log. | |
Additional Inherited Members | |
Public Member Functions inherited from ilog::CLoggerBase | |
| CLoggerBase () | |
| Default constructor. | |
| virtual void | SetLogPtr (ilog::IMessageConsumer *logPtr) override |
| Attach a message consumer for logging. | |
| virtual ilog::IMessageConsumer * | GetLogPtr () const override |
| Get the currently attached message consumer. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Protected Attributes inherited from ilog::CLoggerBase | |
| QSet< int > | m_onceMessageIds |
Template wrapper adding comprehensive logging functionality to components.
TLoggerCompWrap combines any component base class with CLoggerBase to provide full logging capabilities. It automatically integrates with the ACF component system, managing log consumer connections, verbose message support, tracing configuration, and message source decoration.
This is one of the most commonly used templates in the ilog library, providing the standard way to add logging to ACF components.
| Base | Base component class to extend with logging (typically icomp::CComponentBase or a derived class) |
Definition at line 128 of file TLoggerCompWrap.h.
| typedef Base ilog::TLoggerCompWrap< Base >::BaseClass |
Base class typedef for component functionality.
Definition at line 134 of file TLoggerCompWrap.h.
| typedef ilog::CLoggerBase ilog::TLoggerCompWrap< Base >::BaseClass2 |
Base class typedef for logger functionality.
Definition at line 137 of file TLoggerCompWrap.h.
|
overrideprotectedvirtual |
Decorate message before sending.
Adds component ID to message source if ShowComponentId is enabled. Called automatically before messages are sent.
Override to add custom decoration:
| category | Message category |
| id | Message ID |
| flags | Message flags |
| message | Message text (can be modified) |
| messageSource | Message source (can be modified) |
Reimplemented from ilog::CLoggerBase.
Definition at line 304 of file TLoggerCompWrap.h.
References icomp::IComponentContext::GetContextId(), and NULL.
Referenced by ifile::TDeviceBasedSerializerComp< ReadArchive, WriteArchive >::ReadArchiveEx::SendLogMessage(), and ifile::TDeviceBasedSerializerComp< ReadArchive, WriteArchive >::WriteArchiveEx::SendLogMessage().
|
protected |
Check if verbose messages are enabled for a given tracing level.
Determines whether verbose messages at the specified tracing level should be output. Checks both the EnableVerbose attribute and the tracing configuration (if present).
| tracingLevel | Tracing level to check (0=always if enabled, higher=more selective) |
Definition at line 276 of file TLoggerCompWrap.h.
References istd::IInformationProvider::IC_NONE.
|
overrideprotectedvirtual |
Called when component is created.
Automatically connects the log consumer from the "Log" reference.
Reimplemented in idoc::CMultiPageDocumentFilePersistenceComp, ifile::CAutoPersistenceComp, ifile::CFileListProviderComp, ifile::CFileSerializerCompBase, ifile::CFileSystemInfoProviderComp, ifile::CGeneratedFileNameParamComp, ifilegui::CExternalOpenDocumentCommandCompBase, ifilegui::CFileDialogLoaderComp, ipackage::CPackagesLoaderComp, ipackage::CRegistriesManagerComp, iqt::CTranslationManagerComp, iqtdoc::CExternalOpenDocumentCommandComp, and iqtgui::CProcessStartCommandComp.
Definition at line 330 of file TLoggerCompWrap.h.
|
overrideprotectedvirtual |
Called when component is destroyed.
Automatically disconnects the log consumer for cleanup.
Reimplemented in ibase::CConsoleApplicationComp, ifile::CAutoPersistenceComp, ifile::CFileListProviderComp, ifile::CFileSystemInfoProviderComp, ifile::CGeneratedFileNameParamComp, iqt::CTranslationManagerComp, and iqtdoc::CExternalOpenDocumentCommandComp.
Definition at line 341 of file TLoggerCompWrap.h.
References NULL.
|
protected |
Send a verbose message if enabled.
Convenience method for sending verbose/diagnostic messages. The message is only sent if IsVerboseEnabled(tracingLevel) returns true.
Verbose messages use category IC_NONE and are typically used for diagnostic output that's not always needed.
| message | Message text |
| messageSource | Optional message source (default: empty) |
| tracingLevel | Tracing level (0=always if enabled, higher=more selective) |
Definition at line 293 of file TLoggerCompWrap.h.
References istd::IInformationProvider::IC_NONE.