QMessageLogger: make member functions const
Just because we can :) It looks a bit weird that QMessageLogger has a constexpr constructor, but no const methods... Change-Id: I794dd2b3326c45be17b29decb47c9cac4778d397 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
24bc6342ca
commit
3d3c5dc44e
|
|
@ -182,7 +182,7 @@ static void qt_message(QtMsgType msgType, const QMessageLogContext &context, con
|
|||
|
||||
\sa qDebug()
|
||||
*/
|
||||
void QMessageLogger::debug(const char *msg, ...)
|
||||
void QMessageLogger::debug(const char *msg, ...) const
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
|
|
@ -197,7 +197,7 @@ void QMessageLogger::debug(const char *msg, ...)
|
|||
|
||||
\sa qDebug(), QDebug
|
||||
*/
|
||||
QDebug QMessageLogger::debug()
|
||||
QDebug QMessageLogger::debug() const
|
||||
{
|
||||
QDebug dbg = QDebug(QtDebugMsg);
|
||||
QMessageLogContext &ctxt = dbg.stream->context;
|
||||
|
|
@ -212,7 +212,7 @@ QDebug QMessageLogger::debug()
|
|||
|
||||
\sa QNoDebug, qDebug()
|
||||
*/
|
||||
QNoDebug QMessageLogger::noDebug()
|
||||
QNoDebug QMessageLogger::noDebug() const
|
||||
{
|
||||
return QNoDebug();
|
||||
}
|
||||
|
|
@ -226,7 +226,7 @@ QNoDebug QMessageLogger::noDebug()
|
|||
|
||||
\sa qWarning()
|
||||
*/
|
||||
void QMessageLogger::warning(const char *msg, ...)
|
||||
void QMessageLogger::warning(const char *msg, ...) const
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
|
|
@ -240,7 +240,7 @@ void QMessageLogger::warning(const char *msg, ...)
|
|||
|
||||
\sa qWarning(), QDebug
|
||||
*/
|
||||
QDebug QMessageLogger::warning()
|
||||
QDebug QMessageLogger::warning() const
|
||||
{
|
||||
QDebug dbg = QDebug(QtWarningMsg);
|
||||
QMessageLogContext &ctxt = dbg.stream->context;
|
||||
|
|
@ -257,7 +257,7 @@ QDebug QMessageLogger::warning()
|
|||
|
||||
\sa qCritical()
|
||||
*/
|
||||
void QMessageLogger::critical(const char *msg, ...)
|
||||
void QMessageLogger::critical(const char *msg, ...) const
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
|
|
@ -271,7 +271,7 @@ void QMessageLogger::critical(const char *msg, ...)
|
|||
|
||||
\sa qCritical(), QDebug
|
||||
*/
|
||||
QDebug QMessageLogger::critical()
|
||||
QDebug QMessageLogger::critical() const
|
||||
{
|
||||
QDebug dbg = QDebug(QtCriticalMsg);
|
||||
QMessageLogContext &ctxt = dbg.stream->context;
|
||||
|
|
@ -287,7 +287,7 @@ QDebug QMessageLogger::critical()
|
|||
|
||||
\sa qFatal()
|
||||
*/
|
||||
void QMessageLogger::fatal(const char *msg, ...) Q_DECL_NOTHROW
|
||||
void QMessageLogger::fatal(const char *msg, ...) const Q_DECL_NOTHROW
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, msg); // use variable arg list
|
||||
|
|
|
|||
|
|
@ -93,22 +93,22 @@ public:
|
|||
Q_DECL_CONSTEXPR QMessageLogger(const char *file, int line, const char *function, const char *category)
|
||||
: context(file, line, function, category) {}
|
||||
|
||||
void debug(const char *msg, ...)
|
||||
void debug(const char *msg, ...) const
|
||||
#if defined(Q_CC_GNU) && !defined(__INSURE__)
|
||||
__attribute__ ((format (printf, 2, 3)))
|
||||
#endif
|
||||
;
|
||||
void noDebug(const char *, ...)
|
||||
void noDebug(const char *, ...) const
|
||||
#if defined(Q_CC_GNU) && !defined(__INSURE__)
|
||||
__attribute__ ((format (printf, 2, 3)))
|
||||
#endif
|
||||
{}
|
||||
void warning(const char *msg, ...)
|
||||
void warning(const char *msg, ...) const
|
||||
#if defined(Q_CC_GNU) && !defined(__INSURE__)
|
||||
__attribute__ ((format (printf, 2, 3)))
|
||||
#endif
|
||||
;
|
||||
void critical(const char *msg, ...)
|
||||
void critical(const char *msg, ...) const
|
||||
#if defined(Q_CC_GNU) && !defined(__INSURE__)
|
||||
__attribute__ ((format (printf, 2, 3)))
|
||||
#endif
|
||||
|
|
@ -117,18 +117,18 @@ public:
|
|||
#ifndef Q_CC_MSVC
|
||||
Q_NORETURN
|
||||
#endif
|
||||
void fatal(const char *msg, ...) Q_DECL_NOTHROW
|
||||
void fatal(const char *msg, ...) const Q_DECL_NOTHROW
|
||||
#if defined(Q_CC_GNU) && !defined(__INSURE__)
|
||||
__attribute__ ((format (printf, 2, 3)))
|
||||
#endif
|
||||
;
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
QDebug debug();
|
||||
QDebug warning();
|
||||
QDebug critical();
|
||||
QDebug debug() const;
|
||||
QDebug warning() const;
|
||||
QDebug critical() const;
|
||||
|
||||
QNoDebug noDebug();
|
||||
QNoDebug noDebug() const;
|
||||
#endif // QT_NO_DEBUG_STREAM
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Reference in New Issue