diff options
| author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-07-16 11:46:39 +0200 |
|---|---|---|
| committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-07-16 17:59:05 +0200 |
| commit | 1e1c68017338c89265d6664a27f4137fc8960473 (patch) | |
| tree | 360ae1bc38bf6185302d5d7e0b3ca930e058956c /src/corelib/plugin/qlibrary.cpp | |
| parent | 6aa1cb05e357cf4221aaedd4cf742c45983af446 (diff) | |
Logging: use qCDebug/Warning/Info when for categorized logging
When building qt with QT_NO_DEBUG/WARNING/INFO_OUTPUT set, then the
qDebug/Warning/Info macros expand to `QMessageLogger::noDebug`. That
helper is not defined to take a logging category or category function,
so using `qDebug(lcX, ...)` breaks the build. The correct way to emit
categorized logging is to use the qCDebug/Warning/Info macros.
Task-number: QTBUG-125589
Pick-to: 6.8 6.7 6.5
Change-Id: I968b0e826871a09023c11fec9e51caa5a2c4dc0b
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Diffstat (limited to 'src/corelib/plugin/qlibrary.cpp')
| -rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 4d3249d3d96..cc935251421 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -364,7 +364,7 @@ inline void QLibraryStore::cleanup() if (lcDebugLibrary().isDebugEnabled()) { for (auto &[_, lib] : data->libraryMap) { if (lib) - qDebug(lcDebugLibrary) + qCDebug(lcDebugLibrary) << "On QtCore unload," << lib->fileName << "was leaked, with" << lib->libraryRefCount.loadRelaxed() << "users"; } |
