SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <dualfilelogger.h>
Public Member Functions | |
DualFileLogger (QSettings *firstSettings, QSettings *secondSettings, const int refreshInterval=10000, QObject *parent=0) | |
virtual void | log (const QtMsgType type, const QString &message, const QString &file="", const QString &function="", const int line=0) |
virtual void | clear (const bool buffer=true, const bool variables=true) |
Public Member Functions inherited from qtwebapp::Logger | |
Logger (QObject *parent) | |
Logger (const QString msgFormat="{timestamp} {type} {msg}", const QString timestampFormat="yyyy-MM-dd HH:mm:ss.zzz", const QtMsgType minLevel=QtDebugMsg, const int bufferSize=0, QObject *parent=0) | |
virtual | ~Logger () |
void | installMsgHandler () |
void | setMinMessageLevel (const QtMsgType &minMsgLevel) |
QtMsgType | getMinMessageLevel () const |
Private Attributes | |
FileLogger * | firstLogger |
FileLogger * | secondLogger |
Additional Inherited Members | |
Static Public Member Functions inherited from qtwebapp::Logger | |
static void | set (const QString &name, const QString &value) |
Protected Member Functions inherited from qtwebapp::Logger | |
virtual void | write (const LogMessage *logMessage) |
Protected Attributes inherited from qtwebapp::Logger | |
QString | msgFormat |
QString | timestampFormat |
QtMsgType | minLevel |
int | bufferSize |
Static Protected Attributes inherited from qtwebapp::Logger | |
static QMutex | mutex |
Logs messages into two log files simultaneously. May be used to create two logfiles with different configuration settings.
Definition at line 26 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 for changed config settings in msec, or 0=disabled |
parent | Parent object. |
Definition at line 10 of file dualfilelogger.cpp.
References firstLogger, and secondLogger.
|
virtual |
Clear the thread-local data of the current thread. This method is thread safe.
buffer | Whether to clear the backtrace buffer |
variables | Whether to clear the log variables |
Reimplemented from qtwebapp::Logger.
Definition at line 23 of file dualfilelogger.cpp.
References qtwebapp::Logger::clear(), firstLogger, and secondLogger.
|
virtual |
Decorate and log the message, if type>=minLevel. This method is thread safe.
type | Message type (level) |
message | Message text |
file | Name of the source file where the message was generated (usually filled with the macro FILE) |
function | Name of the function where the message was generated (usually filled with the macro LINE) |
line | Line Number of the source file, where the message was generated (usually filles with the macro func or FUNCTION) |
Reimplemented from qtwebapp::Logger.
Definition at line 17 of file dualfilelogger.cpp.
References firstLogger, qtwebapp::Logger::log(), and secondLogger.
|
private |
First logger
Definition at line 67 of file dualfilelogger.h.
Referenced by clear(), DualFileLogger(), and log().
|
private |
Second logger
Definition at line 70 of file dualfilelogger.h.
Referenced by clear(), DualFileLogger(), and log().