diff options
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r-- | src/corelib/io/qdebug.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 9d1ce51da5..91fde75fa5 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -67,7 +67,7 @@ class Q_CORE_EXPORT QDebug friend class QMessageLogger; friend class QDebugStateSaverPrivate; struct Stream { - enum { DefaultVerbosity = 2, VerbosityShift = 29, VerbosityMask = 0x7 }; + enum { VerbosityShift = 29, VerbosityMask = 0x7 }; Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false), flags(DefaultVerbosity << VerbosityShift) {} @@ -92,7 +92,7 @@ class Q_CORE_EXPORT QDebug void setFlag(FormatFlag flag) { if (context.version > 1) { flags |= flag; } } void unsetFlag(FormatFlag flag) { if (context.version > 1) { flags &= ~flag; } } int verbosity() const - { return context.version > 1 ? (flags >> VerbosityShift) & VerbosityMask : int(Stream::DefaultVerbosity); } + { return context.version > 1 ? (flags >> VerbosityShift) & VerbosityMask : int(DefaultVerbosity); } void setVerbosity(int v) { if (context.version > 1) { @@ -123,8 +123,10 @@ public: inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; } inline QDebug &nospace() { stream->space = false; return *this; } inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; } + inline QDebug &verbosity(int verbosityLevel) { setVerbosity(verbosityLevel); return *this; } int verbosity() const { return stream->verbosity(); } void setVerbosity(int verbosityLevel) { stream->setVerbosity(verbosityLevel); } + enum VerbosityLevel { MinimumVerbosity = 0, DefaultVerbosity = 2, MaximumVerbosity = 7 }; bool autoInsertSpaces() const { return stream->space; } void setAutoInsertSpaces(bool b) { stream->space = b; } @@ -195,6 +197,7 @@ public: inline QNoDebug "e() { return *this; } inline QNoDebug &noquote() { return *this; } inline QNoDebug &maybeQuote(const char = '"') { return *this; } + inline QNoDebug &verbosity(int) { return *this; } template<typename T> inline QNoDebug &operator<<(const T &) { return *this; } |