diff options
Diffstat (limited to 'src/corelib/global/qlogging.h')
-rw-r--r-- | src/corelib/global/qlogging.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index f9bbf7fcce..679afddb20 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE class QDebug; class QNoDebug; -enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg }; +enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtInfoMsg, QtSystemMsg = QtCriticalMsg }; class QMessageLogContext { @@ -89,6 +89,7 @@ public: void debug(const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3); void noDebug(const char *, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3) {} + void info(const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3); void warning(const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3); void critical(const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3); @@ -96,6 +97,8 @@ public: void debug(const QLoggingCategory &cat, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4); void debug(CategoryFunction catFunc, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4); + void info(const QLoggingCategory &cat, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4); + void info(CategoryFunction catFunc, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4); void warning(const QLoggingCategory &cat, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4); void warning(CategoryFunction catFunc, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4); void critical(const QLoggingCategory &cat, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4); @@ -110,6 +113,9 @@ public: QDebug debug() const; QDebug debug(const QLoggingCategory &cat) const; QDebug debug(CategoryFunction catFunc) const; + QDebug info() const; + QDebug info(const QLoggingCategory &cat) const; + QDebug info(CategoryFunction catFunc) const; QDebug warning() const; QDebug warning(const QLoggingCategory &cat) const; QDebug warning(CategoryFunction catFunc) const; @@ -137,26 +143,30 @@ private: #define QT_MESSAGELOG_LINE __LINE__ #define QT_MESSAGELOG_FUNC Q_FUNC_INFO #else - #define QT_MESSAGELOG_FILE 0 + #define QT_MESSAGELOG_FILE Q_NULLPTR #define QT_MESSAGELOG_LINE 0 - #define QT_MESSAGELOG_FUNC 0 + #define QT_MESSAGELOG_FUNC Q_NULLPTR #endif #define qDebug QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).debug +#define qInfo QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).info #define qWarning QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).warning #define qCritical QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).critical #define qFatal QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).fatal #define QT_NO_QDEBUG_MACRO while (false) QMessageLogger().noDebug -#define QT_NO_QWARNING_MACRO while (false) QMessageLogger().noDebug #if defined(QT_NO_DEBUG_OUTPUT) # undef qDebug # define qDebug QT_NO_QDEBUG_MACRO #endif +#if defined(QT_NO_INFO_OUTPUT) +# undef qInfo +# define qInfo QT_NO_QDEBUG_MACRO +#endif #if defined(QT_NO_WARNING_OUTPUT) # undef qWarning -# define qWarning QT_NO_QWARNING_MACRO +# define qWarning QT_NO_QDEBUG_MACRO #endif Q_CORE_EXPORT void qt_message_output(QtMsgType, const QMessageLogContext &context, |