Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
logeventsource.cpp File Reference

LogEventSource: Qt message handler that turns log output into events. More...

#include <sonde/logeventsource.h>
#include <QtCore/QHash>
#include <QtCore/QLoggingCategory>
#include <QtCore/QMutex>
#include <QtCore/QPointer>
#include <QtCore/QThread>
#include <array>
#include <atomic>

Classes

struct  Sonde::anonymous_namespace{logeventsource.cpp}::HandlerState
 Process-wide state of the message handler. More...
struct  Sonde::anonymous_namespace{logeventsource.cpp}::CaptureState
 Process-wide state of LogEventSource::captureCategory(). More...
class  Sonde::LogEventSourcePrivate
 LogEventSource's private part. More...

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

HandlerState & Sonde::anonymous_namespace{logeventsource.cpp}::state ()
 The process-wide handler state.
bool & Sonde::anonymous_namespace{logeventsource.cpp}::inHandler ()
 Set while this thread is inside messageHandler() (recursion guard).
int Sonde::anonymous_namespace{logeventsource.cpp}::rank (QtMsgType type)
 Severity rank of a message type: debug 0, info 1, warning 2, critical 3, fatal 4.
CaptureState & Sonde::anonymous_namespace{logeventsource.cpp}::capture ()
 The process-wide capture state.
void Sonde::anonymous_namespace{logeventsource.cpp}::categoryFilter (QLoggingCategory *category)
 Our category filter: the previous filter decides, then captured categories are turned on.
void Sonde::anonymous_namespace{logeventsource.cpp}::applyCaptureFilter ()
 Runs the filter chain again over every category, so a change in what is captured applies.
bool Sonde::anonymous_namespace{logeventsource.cpp}::forwardToApplication (QtMsgType type, const char *category)
 Whether a message of type in category should reach the previous handler.
LogLevel Sonde::anonymous_namespace{logeventsource.cpp}::levelFor (QtMsgType type)
 Maps a Qt message type to an MCP log level.
Event Sonde::anonymous_namespace{logeventsource.cpp}::eventFor (QtMsgType type, const QMessageLogContext &context, const QString &message)
 The event for one log message (without the "thread" field).
QString Sonde::anonymous_namespace{logeventsource.cpp}::currentThreadName ()
 The calling thread's objectName, or its id if it has none.
void Sonde::anonymous_namespace{logeventsource.cpp}::post (Event e)
 Hands e to the active source, if there is one.
void Sonde::anonymous_namespace{logeventsource.cpp}::messageHandler (QtMsgType type, const QMessageLogContext &context, const QString &message)
 The installed Qt message handler: queues an event, then chains to the previous handler.
bool Sonde::anonymous_namespace{logeventsource.cpp}::claimInstance (LogEventSource *source)
 Makes source the active instance unless one exists.

Detailed Description

LogEventSource: Qt message handler that turns log output into events.