Logs messages into two log files. More...
#include <dualfilelogger.h>
Public Member Functions | |
DualFileLogger (QSettings *firstSettings, QSettings *secondSettings, const int refreshInterval=10000, QObject *parent=0) | |
Constructor. | |
virtual void | log (const QtMsgType type, const QString &message) |
Decorate and log a message. |
Logs messages into two log files.
This is specially useful to get one less detailed logfile for normal operation plus one more detailed file for debugging.
Definition at line 23 of file dualfilelogger.h.
DualFileLogger::DualFileLogger | ( | QSettings * | firstSettings, | |
QSettings * | secondSettings, | |||
const int | refreshInterval = 10000 , |
|||
QObject * | parent = 0 | |||
) |
Constructor.
firstSettings | Configuration settings for the first log file, usually stored in an INI file. Must not be 0. Settings are read from the current group, so the caller must have called settings->beginGroup(). Because the group must not change during runtime, it is recommended to provide a separate QSettings instance to the logger that is not used by other parts of the program. | |
secondSettings | Same as firstSettings, but for the second log file. | |
refreshInterval | Interval of checking the config settings in msec, or 0=disabled | |
parent | Parent object |
Definition at line 9 of file dualfilelogger.cpp.
void DualFileLogger::log | ( | const QtMsgType | type, | |
const QString & | message | |||
) | [virtual] |
Decorate and log a message.
This method is thread safe.
type | Message type (level) | |
message | Message text |
Reimplemented from Logger.
Definition at line 17 of file dualfilelogger.cpp.