28 #include "QXmppGlobal.h"
32 #ifdef QXMPP_LOGGABLE_TRACE
33 #define qxmpp_loggable_trace(x) QString("%1(0x%2) %3").arg(metaObject()->className(), QString::number(reinterpret_cast<qint64>(this), 16), x)
35 #define qxmpp_loggable_trace(x) (x)
38 class QXmppLoggerPrivate;
51 Q_PROPERTY(QString logFilePath READ logFilePath WRITE setLogFilePath)
53 Q_PROPERTY(
LoggingType loggingType READ loggingType WRITE setLoggingType)
55 Q_PROPERTY(MessageTypes messageTypes READ messageTypes WRITE setMessageTypes)
71 InformationMessage = 2,
77 Q_DECLARE_FLAGS(MessageTypes, MessageType)
96 void setLogFilePath(
const QString &path);
101 void setMessageTypes(QXmppLogger::MessageTypes types);
104 virtual void setGauge(
const QString &gauge,
double value);
105 virtual void updateCounter(
const QString &counter, qint64 amount);
116 QXmppLoggerPrivate *d;
132 void childEvent(QChildEvent *event)
override;
148 void info(
const QString &message)
191 Q_DECLARE_OPERATORS_FOR_FLAGS(QXmppLogger::MessageTypes)
192 #endif // QXMPPLOGGER_H
@ DebugMessage
Debugging message.
Definition: QXmppLogger.h:70
void message(QXmppLogger::MessageType type, const QString &text)
This signal is emitted whenever a log message is received.
void updateCounter(const QString &counter, qint64 amount=1)
Updates the given counter by amount.
void warning(const QString &message)
Definition: QXmppLogger.h:157
void debug(const QString &message)
Definition: QXmppLogger.h:139
MessageType
This enum describes a type of log message.
Definition: QXmppLogger.h:68
@ ReceivedMessage
Message received from server.
Definition: QXmppLogger.h:73
@ SentMessage
Message sent to server.
Definition: QXmppLogger.h:74
void info(const QString &message)
Definition: QXmppLogger.h:148
@ InformationMessage
Informational message.
Definition: QXmppLogger.h:71
void setGauge(const QString &gauge, double value)
Sets the given gauge to value.
LoggingType
This enum describes how log message are handled.
Definition: QXmppLogger.h:59
QXmppLogger::MessageTypes messageTypes()
Returns the types of messages to log.
The QXmppLogger class represents a sink for logging messages.
Definition: QXmppLogger.h:46
QXmppLogger::LoggingType loggingType()
Returns the handler for logging messages.
@ WarningMessage
Warning message.
Definition: QXmppLogger.h:72
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:124
void logMessage(QXmppLogger::MessageType type, const QString &msg)
This signal is emitted to send logging messages.
void logReceived(const QString &message)
Definition: QXmppLogger.h:166
void logSent(const QString &message)
Definition: QXmppLogger.h:175