From 3994ea1979249e0bf76eb38c89ff3d3dfb1d90b5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 23 Feb 2015 10:06:48 +0100 Subject: Add a verbosity setting to QDebug. Add setters for an int verbosity to QDebug. The streaming operators can check on the setting and output more information accordingly. [ChangeLog][QtCore][QDebug] How verbose a single debug output should be can now be fine-tuned by setting a verbosity on the debug stream. Change-Id: I77001fcf1ef090a580d1a137bb5a667fc1bf1e1b Reviewed-by: Shawn Rutledge --- src/corelib/io/qdebug.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/corelib/io/qdebug.cpp') diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 357d63137ca..8676fe02591 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -334,6 +334,7 @@ QDebug &QDebug::resetFormat() stream->space = true; if (stream->context.version > 1) stream->flags = 0; + stream->setVerbosity(Stream::defaultVerbosity); return *this; } @@ -423,6 +424,32 @@ QDebug &QDebug::resetFormat() \sa quote(), noquote() */ +/*! + \fn int QDebug::verbosity() const + \since 5.6 + + Returns the verbosity of the debug stream. + + Streaming operators can check the value to decide whether + verbose output is desired and print more information depending on the + level. Higher values indicate that more information is desired. + + The allowed range is from 0 to 7. The default value is 2. + + \sa setVerbosity() +*/ + +/*! + \fn void QDebug::setVerbosity(int verbosityLevel) + \since 5.6 + + Sets the verbosity of the stream to \a verbosityLevel. + + The allowed range is from 0 to 7. The default value is 2. + + \sa verbosity() +*/ + /*! \fn QDebug &QDebug::operator<<(QChar t) -- cgit v1.2.3