9#include "QXmppGlobal.h"
15#ifdef QXMPP_LOGGABLE_TRACE
16#define qxmpp_loggable_trace(x) QString("%1(0x%2) %3").arg(metaObject()->className(), QString::number(reinterpret_cast<qint64>(this), 16), x)
18#define qxmpp_loggable_trace(x) (x)
21class QXmppLoggerPrivate;
34 Q_PROPERTY(QString logFilePath READ logFilePath WRITE setLogFilePath NOTIFY logFilePathChanged)
36 Q_PROPERTY(
LoggingType loggingType READ loggingType WRITE setLoggingType NOTIFY loggingTypeChanged)
38 Q_PROPERTY(MessageTypes messageTypes READ messageTypes WRITE setMessageTypes NOTIFY messageTypesChanged)
54 InformationMessage = 2,
60 Q_DECLARE_FLAGS(MessageTypes, MessageType)
80 void setLogFilePath(
const QString &path);
86 void setMessageTypes(QXmppLogger::MessageTypes types);
90 virtual void setGauge(
const QString &gauge,
double value);
91 virtual void updateCounter(
const QString &counter, qint64 amount);
102 const std::unique_ptr<QXmppLoggerPrivate> d;
118 void childEvent(QChildEvent *event)
override;
134 void info(
const QString &message)
177Q_DECLARE_OPERATORS_FOR_FLAGS(QXmppLogger::MessageTypes)
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:110
void logMessage(QXmppLogger::MessageType type, const QString &msg)
This signal is emitted to send logging messages.
void logSent(const QString &message)
Definition: QXmppLogger.h:161
void updateCounter(const QString &counter, qint64 amount=1)
Updates the given counter by amount.
void info(const QString &message)
Definition: QXmppLogger.h:134
void setGauge(const QString &gauge, double value)
Sets the given gauge to value.
void debug(const QString &message)
Definition: QXmppLogger.h:125
void warning(const QString &message)
Definition: QXmppLogger.h:143
void logReceived(const QString &message)
Definition: QXmppLogger.h:152
The QXmppLogger class represents a sink for logging messages.
Definition: QXmppLogger.h:29
Q_SIGNAL void messageTypesChanged()
QXmppLogger::LoggingType loggingType()
Returns the handler for logging messages.
Q_SIGNAL void loggingTypeChanged()
void message(QXmppLogger::MessageType type, const QString &text)
This signal is emitted whenever a log message is received.
MessageType
This enum describes a type of log message.
Definition: QXmppLogger.h:51
@ ReceivedMessage
Message received from server.
Definition: QXmppLogger.h:56
@ InformationMessage
Informational message.
Definition: QXmppLogger.h:54
@ SentMessage
Message sent to server.
Definition: QXmppLogger.h:57
@ DebugMessage
Debugging message.
Definition: QXmppLogger.h:53
@ WarningMessage
Warning message.
Definition: QXmppLogger.h:55
LoggingType
This enum describes how log message are handled.
Definition: QXmppLogger.h:42
QXmppLogger::MessageTypes messageTypes()
Returns the types of messages to log.
Q_SIGNAL void logFilePathChanged()