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

#include <LoggerEngines.h>

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

List of all members.

Public Slots

void logMessage (const QString &message, Logger::MessageType message_type)
 Function which receives a formatted string which needs to be logged.
- Public Slots inherited from Qtilities::Logging::AbstractLoggerEngine
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

void clearLog ()
QString description () const
 Returns a description of the engine.
bool exportBinary (QDataStream &stream) const
 Allows exporting to a QDataStream. A reference to the QDataStream to which the object's information must be appended is provided.
QString factoryTag () const
 The factory tag of this interface.
void finalize ()
 Function which is called to finalize the logger engine.
QString getFileName ()
 Gets the file name to which the logger is currently logging.
bool importBinary (QDataStream &stream)
 Allows importing and reconstruction of the object state from information provided in a QDataStream. A reference to the QDataStream which contains the object's information is provided.
bool initialize ()
 Function which is called to initialize the logger engine.
QString instanceName () const
 The instance name of the logger engine implementing this interface.
bool isFormattingEngineConstant () const
 Indicates if the formatting engine and/or the message contexts can be changed by the user at runtime.
void setFileName (const QString &fileName)
 Sets the file name to which this engine will write the log output.
QString status () const
 Returns a status message for the engine.
ExportModeFlags supportedFormats () const
 Provides information about the export format(s) supported by your implementation of ILoggerExportable.
- Public Member Functions inherited from Qtilities::Logging::AbstractLoggerEngine
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.
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.
bool isInitialized () const
 Returns true if the engine is initialized.
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.

Detailed Description

A logger engine which stores the logged messages in a file.


Member Function Documentation

void Qtilities::Logging::FileLoggerEngine::clearLog ( )
virtual

Clearing of FileLoggerEngine was introduced in Qtilities v1.1.

Reimplemented from Qtilities::Logging::AbstractLoggerEngine.

void Qtilities::Logging::FileLoggerEngine::logMessage ( const QString &  message,
Logger::MessageType  message_type 
)
virtualslot

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.

Implements Qtilities::Logging::AbstractLoggerEngine.

void Qtilities::Logging::FileLoggerEngine::setFileName ( const QString &  fileName)

Sets the file name to which this engine will write the log output.

Its not possible to change the file name while the logger engine is in a initialized state. To change the file name: call finalize(), setFileName() and then call initialize() again.



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