diff options
Diffstat (limited to 'lib/logging.h')
-rw-r--r-- | lib/logging.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/logging.h b/lib/logging.h index 5a3ef6ea..5bf050a9 100644 --- a/lib/logging.h +++ b/lib/logging.h @@ -40,17 +40,15 @@ inline QDebug formatJson(QDebug debug_object) return debug_object.noquote(); } -/** - * @brief A helper operator to facilitate usage of formatJson (and possibly - * other manipulators) - * - * @param debug_object to output the json to - * @param qdm a QDebug manipulator - * @return a copy of debug_object that has its mode altered by qdm - */ -inline QDebug operator<<(QDebug debug_object, QDebugManip qdm) +//! Suppress full qualification of enums/QFlags when logging +inline QDebug terse(QDebug dbg) { - return qdm(debug_object); + return +#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) + dbg.setVerbosity(0), dbg; +#else + dbg.verbosity(QDebug::MinimumVerbosity); +#endif } inline qint64 profilerMinNsecs() @@ -65,6 +63,19 @@ inline qint64 profilerMinNsecs() } } // namespace Quotient +/** + * @brief A helper operator to facilitate usage of formatJson (and possibly + * other manipulators) + * + * @param debug_object to output the json to + * @param qdm a QDebug manipulator + * @return a copy of debug_object that has its mode altered by qdm + */ +inline QDebug operator<<(QDebug debug_object, Quotient::QDebugManip qdm) +{ + return qdm(debug_object); +} + inline QDebug operator<<(QDebug debug_object, const QElapsedTimer& et) { auto val = et.nsecsElapsed() / 1000; |