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


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). | |
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
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.