Log4Qt::ConfiguratorHelper Class Reference

The class ConfiguratorHelper provides a confiuration file watch and last error for configurator classes. More...

#include <configuratorhelper.h>

List of all members.

Public Types

typedef bool(* ConfigureFunc )(const QString &rFileName)

Signals

void configurationFileChanged (const QString &rFileName, bool error)

Static Public Member Functions

static QList< LoggingEventconfigureError ()
static QString configurationFile ()
static ConfiguratorHelperinstance ()
static void setConfigureError (const QList< LoggingEvent > &rConfigureError)
static void setConfigurationFile (const QString &rFileName=QString(), ConfigureFunc pConfigureFunc=0)

Friends

QDebug operator<< (QDebug debug, const ConfiguratorHelper &rConfiguratorHelper)


Detailed Description

The class ConfiguratorHelper provides a confiuration file watch and last error for configurator classes.

A configuration file can be set using setConfigurationFile(). The file is watched for changes. If a change occurs the configuration is reloaded and the ConfigurationFileChanged() signal is emitted. Error information for the last call to a configure function or the last configuration file change can be accessed using configureError().

Note:
All the functions declared in this class are thread-safe.

Member Typedef Documentation

typedef bool(* Log4Qt::ConfiguratorHelper::ConfigureFunc)(const QString &rFileName)

Prototype for a configure callback function. The function is called when then configuration file is changed and takes the configuration file as a parameter.

See also:
setConfigurationFile(), PropertyConfigurator::configure(const QString &)


Member Function Documentation

QList< LoggingEvent > Log4Qt::ConfiguratorHelper::configureError (  )  [inline, static]

Returns the error information for the last configuration operation that took place. The configuration operation could be the result of a call to one of the configure methods or through a change to the configuration file.

See also:
setConfigureError(), PropertyConfigurator::configure(), setConfigurationFile()

References instance(), and mConfigureError.

QString Log4Qt::ConfiguratorHelper::configurationFile (  )  [inline, static]

Returns the current configuration file.

See also:
setConfigurationFile()

References instance(), and mConfigurationFile.

static ConfiguratorHelper* Log4Qt::ConfiguratorHelper::instance (  )  [static]

void Log4Qt::ConfiguratorHelper::setConfigureError ( const QList< LoggingEvent > &  rConfigureError  )  [inline, static]

Sets the configuration error information for the last configuration operation.

See also:
configureError()

References instance(), and mConfigureError.

void Log4Qt::ConfiguratorHelper::setConfigurationFile ( const QString &  rFileName = QString(),
ConfigureFunc  pConfigureFunc = 0 
) [inline, static]

Sets the configuration file to rFileName. The file is watched for changes. On a file change the function pConfigureFunc will be called and the signal configurationFileChange() will be emitted.

Setting the configuration file to an empty string stops the file watch.

See also:
configurationFile(), PropertyConfigurator::configureAndWatch(), configureError()

References doSetConfigurationFile(), and instance().

void Log4Qt::ConfiguratorHelper::configurationFileChanged ( const QString &  rFileName,
bool  error 
) [signal]

The signal is emitted after a change to the file rFileName was processed. If an error occured during the configuration, the flag error will be true and error information is available over configureError().


Friends And Related Function Documentation

QDebug operator<< ( QDebug  debug,
const ConfiguratorHelper rConfiguratorHelper 
) [friend]

Writes all object member variables to the given debug stream rDebug and returns the stream.

ConfiguratorHelper(configurationfile: "" configurefunc: false filesystemwatcher: QObject(0x0) )

See also:
QDebug, ConfiguratorHelper::logManager()


The documentation for this class was generated from the following file:

Generated on Sun Mar 1 16:40:45 2009 for Log4Qt by  doxygen 1.5.6