|
ACF $AcfVersion:0$
|
Base class for stream-based logging components. More...
#include <CStreamLogCompBase.h>
Public Types | |
| typedef ilog::CLogCompBase | BaseClass |
| Base class typedef. | |
Public Types inherited from ilog::CLogCompBase | |
| typedef ilog::TMessageDelegatorComp< icomp::CComponentBase > | BaseClass |
| Base class typedef for component functionality. | |
| typedef QObject | BaseClass2 |
| Base class typedef for QObject functionality. | |
Public Member Functions | |
| CStreamLogCompBase () | |
| istd::IInformationProvider::InformationCategory | GetWorseCategory () const |
| Get worse category (highest code) of all outputed messages. | |
| virtual bool | IsMessageSupported (int messageCategory=-1, int messageId=-1, const istd::IInformationProvider *messagePtr=NULL) const override |
| Check if a message is supported. | |
Public Member Functions inherited from ilog::CLogCompBase | |
| CLogCompBase () | |
| Default constructor. | |
| virtual void | AddMessage (const MessagePtr &messagePtr) override |
| Add a message to this log component. | |
Public Member Functions inherited from icomp::CComponentBase | |
| CComponentBase () | |
| Create component and assign it to specific context. | |
| virtual const icomp::IComponent * | GetParentComponent (bool ownerOnly=false) const override |
| Get parent of this component. | |
| virtual void * | GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="") override |
| Get access to specified component interface. | |
| virtual IComponentContextSharedPtr | GetComponentContext () const override |
| Get access to component context describing all application-specified component information loaded from components registry. | |
| virtual void | SetComponentContext (const IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner) override |
| Set component context of this component. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Protected Member Functions | |
| virtual void | WriteMessageToStream (const istd::IInformationProvider &message) |
| Write formatted message to the output stream. | |
| virtual QString | GenerateMessageText (const istd::IInformationProvider &message) const |
| Generate formatted message text for the output. | |
| virtual void | WriteText (const QString &text, istd::IInformationProvider::InformationCategory category)=0 |
| Write a text line to the output stream. | |
| virtual void | WriteMessageToLog (const MessagePtr &messagePtr) override |
| Abstract method called to process a message. | |
| virtual void | OnComponentDestroyed () override |
Protected Member Functions inherited from icomp::CComponentBase | |
| bool | IsComponentActive () const |
| Check if component is active. | |
| virtual void | OnComponentCreated () |
| virtual const icomp::IRealComponentStaticInfo & | GetComponentStaticInfo () const =0 |
| Get access to static info of this component. | |
Additional Inherited Members | |
Signals inherited from ilog::CLogCompBase | |
| void | EmitAddMessage (const MessagePtr &messagePtr) |
| Signal emitted when a message is added. | |
Static Protected Member Functions inherited from icomp::CComponentBase | |
| static const icomp::IRealComponentStaticInfo & | InitStaticInfo (IComponent *componentPtr) |
| static QByteArray | GetComponentId (const icomp::IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray()) |
Base class for stream-based logging components.
CStreamLogCompBase provides foundation for logging components that output formatted messages to text streams. It handles message filtering by severity, message formatting with customizable elements (category, code, timestamp), and tracks statistics.
Derived classes implement WriteText() to output the formatted message to their specific destination (console, file, network, etc.).
Definition at line 77 of file CStreamLogCompBase.h.
Base class typedef.
Definition at line 81 of file CStreamLogCompBase.h.
| ilog::CStreamLogCompBase::CStreamLogCompBase | ( | ) |
|
protectedvirtual |
Generate formatted message text for the output.
| istd::IInformationProvider::InformationCategory ilog::CStreamLogCompBase::GetWorseCategory | ( | ) | const |
Get worse category (highest code) of all outputed messages.
|
overridevirtual |
Check if a message is supported.
Delegates the check to the slave consumer if present. If no slave is configured, returns true (accepts all messages).
| messageCategory | Message category to check (or -1) |
| messageId | Message ID to check (or -1) |
| messagePtr | Complete message to check (or NULL) |
Reimplemented from ilog::TMessageDelegatorComp< icomp::CComponentBase >.
|
overrideprotectedvirtual |
Reimplemented from icomp::CComponentBase.
Reimplemented in ifile::CTextFileLogComp, and ifile::CTextFileLogStreamerComp.
|
overrideprotectedvirtual |
Abstract method called to process a message.
Derived classes must implement this to define message handling behavior. This is always called on the component's thread, regardless of which thread called AddMessage().
| messagePtr | Shared pointer to message to process |
Implements ilog::CLogCompBase.
|
protectedvirtual |
Write formatted message to the output stream.
|
protectedpure virtual |
Write a text line to the output stream.
Implemented in ifile::CTextFileLogComp, ifile::CTextFileLogStreamerComp, and ilog::CConsoleLogComp.