Files
utun2/tools/chatgui/src/gui_log.cpp
T
evgeny 7c814f5cb9 Route desktop codec diagnostics through the shared log
Quiet capability probes, preserve runtime errors, and register the desktop portal application. Add logging and desktop launcher regression coverage.
2026-10-21 15:45:40 +02:00

18 lines
867 B
C++

#include "gui_log.h"
#include "debug_config.h"
#include <QByteArray>
#include <QString>
#include <cstring>
static void guiLog(QtMsgType type, const QMessageLogContext& context, const QString& message) {
const debug_level_t level = type == QtDebugMsg ? DEBUG_LEVEL_DEBUG : type == QtInfoMsg ? DEBUG_LEVEL_INFO
: type == QtWarningMsg ? DEBUG_LEVEL_WARN : DEBUG_LEVEL_ERROR;
const char* name = context.category ? context.category : "default";
const int category = !strncmp(name, "qt.multimedia", 13) ? DEBUG_CATEGORY_VIDEO : DEBUG_CATEGORY_GENERAL;
if (!debug_should_output(level, category)) return;
const auto text = message.toUtf8();
debug_output(level, category, context.function, context.file, context.line, "Qt[%s]: %s", name, text.constData());
}
QtMessageHandler installGuiLogHandler() { return qInstallMessageHandler(guiLog); }