aboutsummaryrefslogtreecommitdiff
path: root/lib/logging.h
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-08-24 09:41:51 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-08-24 09:41:51 +0200
commit82f4efb0227e7e22e831733fae3952818b063ac2 (patch)
tree3b154a16f9d355996a59c611230d0e010edab57f /lib/logging.h
parent16d4f4e48304543a0ab59b235edba07f5f2c2204 (diff)
parent6308bff3336ca7680eee54d9bd125f780fa9f033 (diff)
downloadlibquotient-82f4efb0227e7e22e831733fae3952818b063ac2.tar.gz
libquotient-82f4efb0227e7e22e831733fae3952818b063ac2.zip
Merge branch 'dev' into device-verification
# Conflicts: # autotests/testfilecrypto.cpp # lib/connection.cpp # lib/connection.h # lib/database.cpp # lib/database.h # lib/e2ee/qolmoutboundsession.cpp # lib/e2ee/qolmoutboundsession.h # lib/eventitem.h # lib/events/encryptedevent.cpp # lib/events/encryptedevent.h # lib/events/encryptedfile.cpp # lib/events/encryptedfile.h # lib/events/keyverificationevent.cpp # lib/events/keyverificationevent.h # lib/events/roomkeyevent.h # lib/room.cpp # lib/room.h
Diffstat (limited to 'lib/logging.h')
-rw-r--r--lib/logging.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/logging.h b/lib/logging.h
index fc0a4c99..1fafa04b 100644
--- a/lib/logging.h
+++ b/lib/logging.h
@@ -44,12 +44,7 @@ inline QDebug formatJson(QDebug debug_object)
//! Suppress full qualification of enums/QFlags when logging
inline QDebug terse(QDebug dbg)
{
- return
-#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
- dbg.setVerbosity(0), dbg;
-#else
- dbg.verbosity(QDebug::MinimumVerbosity);
-#endif
+ return dbg.verbosity(QDebug::MinimumVerbosity);
}
inline qint64 profilerMinNsecs()
@@ -74,15 +69,13 @@ inline qint64 profilerMinNsecs()
*/
inline QDebug operator<<(QDebug debug_object, Quotient::QDebugManip qdm)
{
- return qdm(debug_object);
+ return qdm(debug_object); // NOLINT(performance-unnecessary-value-param)
}
-inline QDebug operator<<(QDebug debug_object, const QElapsedTimer& et)
+inline QDebug operator<<(QDebug debug_object, QElapsedTimer et)
{
- auto val = et.nsecsElapsed() / 1000;
- if (val < 1000)
- debug_object << val << "µs";
- else
- debug_object << val / 1000 << "ms";
+ // NOLINTNEXTLINE(bugprone-integer-division)
+ debug_object << static_cast<double>(et.nsecsElapsed() / 1000) / 1000
+ << "ms"; // Show in ms with 3 decimal digits precision
return debug_object;
}