v2.0.0
Loading...
Searching...
No Matches
mne_logger.h File Reference

Custom Qt message handler that adds ANSI colour, timestamps and source-location tags to qDebug/qWarning output. More...

#include "../utils_global.h"
#include <mutex>
#include <QSharedPointer>
#include <QMutex>
Include dependency graph for mne_logger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UTILSLIB::MNELogger
 Custom Qt message handler that formats and routes qDebug/qWarning/qCritical output to file or console. More...

Namespaces

namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Detailed Description

Custom Qt message handler that adds ANSI colour, timestamps and source-location tags to qDebug/qWarning output.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.1.0
Date
March 2026

UTILSLIB::MNELogger installs a single QtMessageHandler via qInstallMessageHandler so every qDebug, qInfo, qWarning, qCritical and qFatal call across mne-cpp is formatted consistently and serialised through one std::mutex — necessary because Qt's default handler is not thread-safe and acquisition plugins emit log lines from many worker threads simultaneously.

Each line is prefixed with the message type (colourised on TTYs that report xterm-256color) and the originating file/line/function so log triage in user-submitted bug reports does not require attaching a debugger.

Definition in file mne_logger.h.