Fix QMessageLogger and associated qdoc errors

Change-Id: I4b9555c8a15a698ef5ce270288c88a0aa88e0033
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
This commit is contained in:
Jeremy Katz 2012-08-06 16:01:30 +02:00 committed by Qt by Nokia
parent b44670e671
commit 61fa926857

View File

@ -176,6 +176,12 @@ static void qt_message(QtMsgType msgType, const QMessageLogContext &context, con
} }
#undef qDebug #undef qDebug
/*!
Logs a debug message specified with format \a msg. Additional
parameters, specified by \a msg, may be used.
\sa qDebug()
*/
void QMessageLogger::debug(const char *msg, ...) void QMessageLogger::debug(const char *msg, ...)
{ {
va_list ap; va_list ap;
@ -186,6 +192,11 @@ void QMessageLogger::debug(const char *msg, ...)
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
/*!
Logs a debug message using a QDebug stream
\sa qDebug(), QDebug
*/
QDebug QMessageLogger::debug() QDebug QMessageLogger::debug()
{ {
QDebug dbg = QDebug(QtDebugMsg); QDebug dbg = QDebug(QtDebugMsg);
@ -194,6 +205,13 @@ QDebug QMessageLogger::debug()
return dbg; return dbg;
} }
/*!
\internal
Returns a QNoDebug object, which is used to ignore debugging output.
\sa QNoDebug, qDebug()
*/
QNoDebug QMessageLogger::noDebug() QNoDebug QMessageLogger::noDebug()
{ {
return QNoDebug(); return QNoDebug();
@ -202,6 +220,12 @@ QNoDebug QMessageLogger::noDebug()
#endif #endif
#undef qWarning #undef qWarning
/*!
Logs a warning message specified with format \a msg. Additional
parameters, specified by \a msg, may be used.
\sa qWarning()
*/
void QMessageLogger::warning(const char *msg, ...) void QMessageLogger::warning(const char *msg, ...)
{ {
va_list ap; va_list ap;
@ -211,6 +235,11 @@ void QMessageLogger::warning(const char *msg, ...)
} }
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
/*!
Logs a debug message using a QDebug stream
\sa qWarning(), QDebug
*/
QDebug QMessageLogger::warning() QDebug QMessageLogger::warning()
{ {
QDebug dbg = QDebug(QtWarningMsg); QDebug dbg = QDebug(QtWarningMsg);
@ -221,6 +250,13 @@ QDebug QMessageLogger::warning()
#endif #endif
#undef qCritical #undef qCritical
/*!
Logs a critical message specified with format \a msg. Additional
parameters, specified by \a msg, may be used.
\sa qCritical()
*/
void QMessageLogger::critical(const char *msg, ...) void QMessageLogger::critical(const char *msg, ...)
{ {
va_list ap; va_list ap;
@ -230,6 +266,11 @@ void QMessageLogger::critical(const char *msg, ...)
} }
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
/*!
Logs a critical message using a QDebug stream
\sa qCritical(), QDebug
*/
QDebug QMessageLogger::critical() QDebug QMessageLogger::critical()
{ {
QDebug dbg = QDebug(QtCriticalMsg); QDebug dbg = QDebug(QtCriticalMsg);
@ -240,7 +281,13 @@ QDebug QMessageLogger::critical()
#endif #endif
#undef qFatal #undef qFatal
void QMessageLogger::fatal(const char *msg, ...) Q_DECL_NOTHROW /*!
Logs a fatal message specified with format \a msg. Additional
parameters, specified by \a msg, may be used.
\sa qFatal()
*/
void QMessageLogger::fatal(const char *msg, ...) Q_DECL_NOTHROW
{ {
va_list ap; va_list ap;
va_start(ap, msg); // use variable arg list va_start(ap, msg); // use variable arg list
@ -807,7 +854,7 @@ void qErrnoWarning(int code, const char *msg, ...)
Installs a Qt message \a handler which has been defined Installs a Qt message \a handler which has been defined
previously. This method is deprecated, use qInstallMessageHandler previously. This method is deprecated, use qInstallMessageHandler
instead. instead.
\sa QtMsgHandler, qInstallMessageHandler \sa QtMsgHandler, qInstallMessageHandler()
*/ */
/*! /*!
\fn void qSetMessagePattern(const QString &pattern) \fn void qSetMessagePattern(const QString &pattern)
@ -832,15 +879,15 @@ void qErrnoWarning(int code, const char *msg, ...)
\row \li \c %{type} \li "debug", "warning", "critical" or "fatal" \row \li \c %{type} \li "debug", "warning", "critical" or "fatal"
\endtable \endtable
The default pattern is "%{message}". The default \a pattern is "%{message}".
The pattern can also be changed at runtime by setting the QT_MESSAGE_PATTERN The \a pattern can also be changed at runtime by setting the QT_MESSAGE_PATTERN
environment variable; if both qSetMessagePattern() is called and QT_MESSAGE_PATTERN is environment variable; if both qSetMessagePattern() is called and QT_MESSAGE_PATTERN is
set, the environment variable takes precedence. set, the environment variable takes precedence.
qSetMessagePattern() has no effect if a custom message handler is installed. qSetMessagePattern() has no effect if a custom message handler is installed.
\sa qInstallMessageHandler, {Debugging Techniques} \sa qInstallMessageHandler(), {Debugging Techniques}
*/ */
QtMessageHandler qInstallMessageHandler(QtMessageHandler h) QtMessageHandler qInstallMessageHandler(QtMessageHandler h)
@ -871,6 +918,10 @@ void qSetMessagePattern(const QString &pattern)
qMessagePattern()->setPattern(pattern); qMessagePattern()->setPattern(pattern);
} }
/*!
Copies context information from \a logContext into this QMessageLogContext
\internal
*/
void QMessageLogContext::copy(const QMessageLogContext &logContext) void QMessageLogContext::copy(const QMessageLogContext &logContext)
{ {
this->category = logContext.category; this->category = logContext.category;
@ -879,4 +930,48 @@ void QMessageLogContext::copy(const QMessageLogContext &logContext)
this->function = logContext.function; this->function = logContext.function;
} }
/*!
\fn QMessageLogger::QMessageLogger()
Constructs a default QMessageLogger. See the other constructors to specify
context information.
*/
/*!
\fn QMessageLogger::QMessageLogger(const char *file, int line, const char *function)
Constructs a QMessageLogger to record log messages for \a file at \a line
in \a function. The is equivalent to QMessageLogger(file, line, function, "default")
*/
/*!
\fn QMessageLogger::QMessageLogger(const char *file, int line, const char *function, const char *category)
Constructs a QMessageLogger to record \a category messages for \a file at \a line
in \a function.
*/
/*!
\fn void QMessageLogger::noDebug(const char *, ...)
\internal
Ignores logging output
\sa QNoDebug, qDebug()
*/
/*!
\fn QMessageLogContext::QMessageLogContext()
\internal
Constructs a QMessageLogContext
*/
/*!
\fn QMessageLogContext::QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName)
\internal
Constructs a QMessageLogContext with for file \a fileName at line
\a lineNumber, in function \a functionName, and category \a CategoryName.
*/
QT_END_NAMESPACE QT_END_NAMESPACE