#include <configuratorhelper.h>
Public Types | |
typedef bool(* | ConfigureFunc )(const QString &rFileName) |
Signals | |
void | configurationFileChanged (const QString &rFileName, bool error) |
Static Public Member Functions | |
static QList< LoggingEvent > | configureError () |
static QString | configurationFile () |
static ConfiguratorHelper * | instance () |
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) |
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().
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.
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.
References instance(), and mConfigureError.
QString Log4Qt::ConfiguratorHelper::configurationFile | ( | ) | [inline, static] |
Returns the current configuration file.
References instance(), and mConfigurationFile.
static ConfiguratorHelper* Log4Qt::ConfiguratorHelper::instance | ( | ) | [static] |
Returns the ConfiguratorHelper instance.
Referenced by configurationFile(), configureError(), setConfigurationFile(), and setConfigureError().
void Log4Qt::ConfiguratorHelper::setConfigureError | ( | const QList< LoggingEvent > & | rConfigureError | ) | [inline, static] |
Sets the configuration error information for the last configuration operation.
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.
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().
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) )