From fba4ca0ec11d653791a7f6fb1e1d5e06103aeebb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 22 Sep 2021 19:31:32 -0700 Subject: QLibrary/QPlugin/QFactoryLoader: convert to category logging This adds three categories: - qt.core.library - qt.core.plugin.loader - qt.core.plugin.factoryloader plus the "qt.core.plugin.elfparser" category (only available in developer builds). All three use the new Q_LOGGING_CATEGORY_WITH_ENV_OVERRIDE technique which enables their debugging if the QT_DEBUG_PLUGINS=1 variable is set. As a consequence, some warnings were downgraded to debug messages. I've only left as warnings situations where a real problem occurred, since they now get printed by default: failures to open or mmap a file, corrupt plugin metadata (but not scan of non-plugins), use of QPluginLoader with a static build of Qt. Drive-by update of some messages to make them prettier and/or use qUtf16Printable(). Change-Id: I3eb1bd30e0124f89a052fffd16a752acfe89c19e Reviewed-by: Kai Koehne --- src/corelib/plugin/qlibrary_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/plugin/qlibrary_p.h') diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h index 3c43d79e25..42d3d7256d 100644 --- a/src/corelib/plugin/qlibrary_p.h +++ b/src/corelib/plugin/qlibrary_p.h @@ -55,6 +55,7 @@ #include "QtCore/qlibrary.h" #include "QtCore/private/qfactoryloader_p.h" +#include "QtCore/qloggingcategory.h" #include "QtCore/qmutex.h" #include "QtCore/qplugin.h" #include "QtCore/qpointer.h" @@ -67,7 +68,7 @@ QT_REQUIRE_CONFIG(library); QT_BEGIN_NAMESPACE -bool qt_debug_component(); +Q_DECLARE_LOGGING_CATEGORY(qt_lcDebugPlugins) struct QLibraryScanResult { -- cgit v1.2.3