9#include "QXmppGlobal.h"
13#ifdef QXMPP_LOGGABLE_TRACE
14#define qxmpp_loggable_trace(x) QString("%1(0x%2) %3").arg(metaObject()->className(), QString::number(reinterpret_cast<qint64>(this), 16), x)
16#define qxmpp_loggable_trace(x) (x)
19class QXmppLoggerPrivate;
32 Q_PROPERTY(QString logFilePath READ logFilePath WRITE setLogFilePath)
34 Q_PROPERTY(
LoggingType loggingType READ loggingType WRITE setLoggingType)
36 Q_PROPERTY(MessageTypes messageTypes READ messageTypes WRITE setMessageTypes)
52 InformationMessage = 2,
58 Q_DECLARE_FLAGS(MessageTypes, MessageType)
77 void setLogFilePath(
const QString &path);
82 void setMessageTypes(QXmppLogger::MessageTypes types);
85 virtual void setGauge(
const QString &gauge,
double value);
86 virtual void updateCounter(
const QString &counter, qint64 amount);
97 QXmppLoggerPrivate *d;
113 void childEvent(QChildEvent *event)
override;
129 void info(
const QString &message)
172Q_DECLARE_OPERATORS_FOR_FLAGS(QXmppLogger::MessageTypes)
The QXmppLoggable class represents a source of logging messages.
Definition QXmppLogger.h:105
void logMessage(QXmppLogger::MessageType type, const QString &msg)
This signal is emitted to send logging messages.
void logSent(const QString &message)
Definition QXmppLogger.h:156
void updateCounter(const QString &counter, qint64 amount=1)
Updates the given counter by amount.
void info(const QString &message)
Definition QXmppLogger.h:129
void setGauge(const QString &gauge, double value)
Sets the given gauge to value.
void debug(const QString &message)
Definition QXmppLogger.h:120
void warning(const QString &message)
Definition QXmppLogger.h:138
void logReceived(const QString &message)
Definition QXmppLogger.h:147
The QXmppLogger class represents a sink for logging messages.
Definition QXmppLogger.h:27
QXmppLogger::LoggingType loggingType()
Returns the handler for logging messages.
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:49
@ ReceivedMessage
Message received from server.
Definition QXmppLogger.h:54
@ InformationMessage
Informational message.
Definition QXmppLogger.h:52
@ SentMessage
Message sent to server.
Definition QXmppLogger.h:55
@ DebugMessage
Debugging message.
Definition QXmppLogger.h:51
@ WarningMessage
Warning message.
Definition QXmppLogger.h:53
LoggingType
This enum describes how log message are handled.
Definition QXmppLogger.h:40
QXmppLogger::MessageTypes messageTypes()
Returns the types of messages to log.