All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Slots | Public Member Functions
Qtilities::Logging::AbstractLoggerEngine Class Reference

The base class of all logger engines. More...

#include <AbstractLoggerEngine.h>

Inheritance diagram for Qtilities::Logging::AbstractLoggerEngine:
Inheritance graph
[legend]

List of all members.

Public Slots

virtual void finalize ()=0
 Function which is called to finalize the logger engine.
virtual void newMessages (const QString &engine_name, Logger::MessageType message_type, Logger::MessageContextFlags message_context, const QList< QVariant > &messages)
 Slot which is connected to the newMessage() signal of the Logger class.

Public Member Functions

virtual void clearLog ()
 Clears the log currently hold by the logger engine.
virtual QString description () const =0
 Returns a description of the engine.
virtual void enableAllMessageTypes ()
 Enables all message types for this engine.
QString formattingEngineName ()
 Returns the name of the installed formatting engine.
Logger::MessageTypeFlags getEnabledMessageTypes () const
 Returns the enabled message types for this engine.
AbstractFormattingEnginegetInstalledFormattingEngine ()
 Returns a reference to the formatting engine used by this engine.
virtual bool initialize ()=0
 Function which is called to initialize the logger engine.
void installFormattingEngine (AbstractFormattingEngine *engine)
 Installs a formatting engine which needs to be used by this engine.
bool isActive () const
 Indicates if the engine is active.
virtual bool isFormattingEngineConstant () const =0
 Indicates if the formatting engine and/or the message contexts can be changed by the user at runtime.
bool isInitialized () const
 Returns true if the engine is initialized.
virtual void logMessage (const QString &message, Logger::MessageType message_type=Logger::Info)=0
 Function which receives a formatted string which needs to be logged.
Logger::MessageContextFlags messageContexts () const
 Returns the logging contexts for which this engine accepts messages.
QString name () const
 Returns the name of the engine.
virtual bool removable () const
 Gets if the user can remove this engine.
void setActive (bool is_active)
 Sets the activity of the engine.
virtual void setEnabledMessageTypes (Logger::MessageTypeFlags message_types)
 Sets the enabled message types for this engine.
void setMessageContexts (Logger::MessageContextFlags message_contexts)
 Sets the logging contexts for which this engine accepts messages.
void setName (const QString &name)
 Sets the name of the engine.
virtual void setRemovable (bool is_removable)
 Sets if the user can remove this engine.
virtual QString status () const =0
 Returns a status message for the engine.

Detailed Description

The base class of all logger engines.


Member Function Documentation

virtual void Qtilities::Logging::AbstractLoggerEngine::clearLog ( )
inlinevirtual

Clears the log currently hold by the logger engine.

Note:
This is not supported by all logger engines. See the class documentation of the logger engine you are interested in to see if it is supported.

Reimplemented in Qtilities::CoreGui::WidgetLoggerEngine, and Qtilities::Logging::FileLoggerEngine.

virtual void Qtilities::Logging::AbstractLoggerEngine::logMessage ( const QString &  message,
Logger::MessageType  message_type = Logger::Info 
)
pure virtual

Function which receives a formatted string which needs to be logged.

Messages arrives at logger engines through the newMessages() slot which will format the messages and validate if they must be logged. If so, this function will be called with a formatted message. If you wish to handle the message formatting manually, you can reimplement the newMessages() function.

Implemented in Qtilities::Logging::ConsoleLoggerEngine, Qtilities::Logging::QtMsgLoggerEngine, Qtilities::CoreGui::WidgetLoggerEngine, and Qtilities::Logging::FileLoggerEngine.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé