Custom Qt message handler that formats and routes qDebug/qWarning/qCritical output to file or console. More...
#include <mne_logger.h>
Static Public Member Functions | |
| static void | customLogWriter (QtMsgType type, const QMessageLogContext &context, const QString &msg) |
| static bool | setLogFile (const QString &sFilePath) |
| static QString | logFile () |
Custom Qt message handler that formats and routes qDebug/qWarning/qCritical output to file or console.
The Apllicationlogger provides colorized keywords in terminal outputs for better overview
Definition at line 58 of file mne_logger.h.
|
static |
Customized logWriter to colorize type of the message in the terminal
| [in] | type | Enum to identify the various message types (qDebug, qInfo, qCritical, qWarning and qFatal). |
| [in] | context | Context provides information about the source code location. |
| [in] | msg | The message to print in the terminal. |
Definition at line 105 of file mne_logger.cpp.
|
static |
Returns the path of the current log file, empty if file logging is off.
Definition at line 98 of file mne_logger.cpp.
|
static |
Additionally writes every message to a log file.
Console output is unaffected. The file is opened in append mode and each line is prefixed with a timestamp and the message level, without the terminal colour codes. Passing an empty path stops file logging.
| [in] | sFilePath | Path of the log file, or an empty string to disable. |
Definition at line 72 of file mne_logger.cpp.