QtWebApp
dualfilelogger.cpp
Go to the documentation of this file.
1 
6 #include "dualfilelogger.h"
7 
8 using namespace stefanfrings;
9 
10 DualFileLogger::DualFileLogger(QSettings *firstSettings, QSettings* secondSettings, const int refreshInterval, QObject* parent)
11  :Logger(parent)
12 {
13  firstLogger=new FileLogger(firstSettings, refreshInterval, this);
14  secondLogger=new FileLogger(secondSettings, refreshInterval, this);
15 }
16 
17 void DualFileLogger::log(const QtMsgType type, const QString& message, const QString &file, const QString &function, const int line)
18 {
19  firstLogger->log(type,message,file,function,line);
20  secondLogger->log(type,message,file,function,line);
21 }
22 
23 void DualFileLogger::clear(const bool buffer, const bool variables)
24 {
25  firstLogger->clear(buffer,variables);
26  secondLogger->clear(buffer,variables);
27 }
virtual void clear(const bool buffer=true, const bool variables=true)
Clear the thread-local data of the current thread.
virtual void log(const QtMsgType type, const QString &message, const QString &file="", const QString &function="", const int line=0)
Decorate and log the message, if type>=minLevel.
DualFileLogger(QSettings *firstSettings, QSettings *secondSettings, const int refreshInterval=10000, QObject *parent=nullptr)
Constructor.
Logger that uses a text file for output.
Definition: filelogger.h:56
Decorates and writes log messages to the console, stderr.
Definition: logger.h:52
virtual void clear(const bool buffer=true, const bool variables=true)
Clear the thread-local data of the current thread.
Definition: logger.cpp:140
virtual void log(const QtMsgType type, const QString &message, const QString &file="", const QString &function="", const int line=0)
Decorate and log the message, if type>=minLevel.
Definition: logger.cpp:160