QMessageLogger ClassThe QMessageLogger class generates log messages. More... #include <QMessageLogger> This class was introduced in Qt 5.0. Public Functions
Detailed DescriptionThe QMessageLogger class generates log messages. QMessageLogger is used to generate messages for the Qt logging framework. Usually one uses it through qDebug(), qWarning(), qCritical, or qFatal() functions, which are actually macros that expand to QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO).debug() et al. One example of direct use is to forward errors that stem from a scripting language, e.g. QML: void statusChanged(QDeclarativeComponent::Status status) { if (status == QDeclarativeComponent::Error) { foreach (const QDeclarativeError &error, component->errors()) { const QByteArray file = error.url().toEncoded(); QMessageLogger(file.constData(), error.line(), 0).debug() << error.description(); } } } See also QMessageLogContext, qDebug(), qWarning(), qCritical(), and qFatal(). Member Function Documentation
|