aboutsummaryrefslogtreecommitdiff
path: root/lib/logging.h
diff options
context:
space:
mode:
authorarawaaa <77910862+arawaaa@users.noreply.github.com>2021-12-27 17:35:28 -0600
committerGitHub <noreply@github.com>2021-12-27 17:35:28 -0600
commit7ec3ba834dd313c4408622da30e04cdc6f4cf7c7 (patch)
tree679d7dc5939a229ad46676cd1d7aeaea7a25abce /lib/logging.h
parent17bf4d180297c7e87363e179b8afa79ddb15dca7 (diff)
parent674e984e459375974f619d0e778d43a2cc928dc3 (diff)
downloadlibquotient-7ec3ba834dd313c4408622da30e04cdc6f4cf7c7.tar.gz
libquotient-7ec3ba834dd313c4408622da30e04cdc6f4cf7c7.zip
Merge branch 'dev' into pinned
Diffstat (limited to 'lib/logging.h')
-rw-r--r--lib/logging.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/lib/logging.h b/lib/logging.h
index 432ed16f..5bf050a9 100644
--- a/lib/logging.h
+++ b/lib/logging.h
@@ -16,6 +16,8 @@ Q_DECLARE_LOGGING_CATEGORY(EPHEMERAL)
Q_DECLARE_LOGGING_CATEGORY(E2EE)
Q_DECLARE_LOGGING_CATEGORY(JOBS)
Q_DECLARE_LOGGING_CATEGORY(SYNCJOB)
+Q_DECLARE_LOGGING_CATEGORY(THUMBNAILJOB)
+Q_DECLARE_LOGGING_CATEGORY(NETWORK)
Q_DECLARE_LOGGING_CATEGORY(PROFILER)
namespace Quotient {
@@ -35,24 +37,18 @@ using QDebugManip = QDebug (*)(QDebug);
*/
inline QDebug formatJson(QDebug debug_object)
{
-#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
- return debug_object;
-#else
return debug_object.noquote();
-#endif
}
-/**
- * @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()
@@ -66,8 +62,19 @@ inline qint64 profilerMinNsecs()
* 1000;
}
} // namespace Quotient
-/// \deprecated Use namespace Quotient instead
-namespace QMatrixClient = 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)
{