diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-06-06 13:44:35 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-06-17 09:31:08 +0200 |
| commit | 38696eadc49209d2acdbf7331cba42c71ed2f237 (patch) | |
| tree | 6dffb4604485d36add3f4571bd9130e956d7a884 /src | |
| parent | bffee8b06d960d3c84fab46895ae2edbe1e066c1 (diff) | |
QtQml: Straighten out some logging categories
Either make them static or declare them in a header. We want them to be
static wherever possible, in order to reduce the number of visible
symbols. If they can't be static, however, they should at least be
declared in only one place.
Task-number: QTBUG-67692
Change-Id: I91fa641b46510ea8902b478d31dfd60d34b5f580
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
27 files changed, 38 insertions, 40 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 25831eab73..8a81bc98f9 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -30,8 +30,8 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -Q_LOGGING_CATEGORY(lcQmlUsedBeforeDeclared, "qt.qml.usedbeforedeclared"); -Q_LOGGING_CATEGORY(lcQmlInjectedParameter, "qt.qml.injectedparameter"); +Q_STATIC_LOGGING_CATEGORY(lcQmlUsedBeforeDeclared, "qt.qml.usedbeforedeclared"); +Q_STATIC_LOGGING_CATEGORY(lcQmlInjectedParameter, "qt.qml.injectedparameter"); using namespace QV4; using namespace QV4::Compiler; diff --git a/src/qml/jit/qv4assemblercommon.cpp b/src/qml/jit/qv4assemblercommon.cpp index 2b33d0aa10..b18b4960b7 100644 --- a/src/qml/jit/qv4assemblercommon.cpp +++ b/src/qml/jit/qv4assemblercommon.cpp @@ -23,7 +23,7 @@ QT_BEGIN_NAMESPACE namespace QV4 { namespace JIT { -Q_LOGGING_CATEGORY(lcAsm, "qt.qml.v4.asm") +Q_STATIC_LOGGING_CATEGORY(lcAsm, "qt.qml.v4.asm") namespace { class QIODevicePrintStream: public FilePrintStream diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 1ad5e063e8..766d0e1994 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -22,7 +22,7 @@ using namespace QV4; using namespace Qt::Literals::StringLiterals; -Q_LOGGING_CATEGORY(lcJavaScriptGlobals, "qt.qml.js.globals") +Q_STATIC_LOGGING_CATEGORY(lcJavaScriptGlobals, "qt.qml.js.globals") DEFINE_OBJECT_VTABLE(Object); diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index 53444cddb7..e1e882cb06 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -26,7 +26,7 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQmlContext, "qt.qml.context"); +Q_STATIC_LOGGING_CATEGORY(lcQmlContext, "qt.qml.context"); using namespace QV4; diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index eaee078a5f..b1d2b77a33 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -50,10 +50,10 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcBuiltinsBindingRemoval, "qt.qml.binding.removal", QtWarningMsg) -Q_LOGGING_CATEGORY(lcObjectConnect, "qt.qml.object.connect", QtWarningMsg) -Q_LOGGING_CATEGORY(lcOverloadResolution, "qt.qml.overloadresolution", QtWarningMsg) -Q_LOGGING_CATEGORY(lcMethodBehavior, "qt.qml.method.behavior") -Q_LOGGING_CATEGORY(lcSignalHandler, "qt.qml.signalhandler") +Q_STATIC_LOGGING_CATEGORY(lcObjectConnect, "qt.qml.object.connect", QtWarningMsg) +Q_STATIC_LOGGING_CATEGORY(lcOverloadResolution, "qt.qml.overloadresolution", QtWarningMsg) +Q_STATIC_LOGGING_CATEGORY(lcMethodBehavior, "qt.qml.method.behavior") +Q_STATIC_LOGGING_CATEGORY(lcSignalHandler, "qt.qml.signalhandler") // The code in this file does not violate strict aliasing, but GCC thinks it does // so turn off the warnings for us to have a clean build diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index 288585f844..afd5b8ddc8 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -29,6 +29,8 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcBuiltinsBindingRemoval) + class QObject; class QQmlData; class QQmlPropertyCache; diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 5977360080..8582f44668 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcCoercingTypeAssertion, "qt.qml.coercingTypeAssertion"); +Q_STATIC_LOGGING_CATEGORY(lcCoercingTypeAssertion, "qt.qml.coercingTypeAssertion"); namespace QV4 { diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 8f6a6503fc..d740969131 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -56,10 +56,8 @@ #include <pthread_np.h> #endif -Q_LOGGING_CATEGORY(lcGcStats, "qt.qml.gc.statistics") -Q_DECLARE_LOGGING_CATEGORY(lcGcStats) -Q_LOGGING_CATEGORY(lcGcAllocatorStats, "qt.qml.gc.allocatorStats") -Q_DECLARE_LOGGING_CATEGORY(lcGcAllocatorStats) +Q_STATIC_LOGGING_CATEGORY(lcGcStats, "qt.qml.gc.statistics") +Q_STATIC_LOGGING_CATEGORY(lcGcAllocatorStats, "qt.qml.gc.allocatorStats") using namespace WTF; diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index 63e67ac804..d495247f33 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -27,9 +27,6 @@ QT_BEGIN_NAMESPACE -Q_DECLARE_LOGGING_CATEGORY(lcQml); -Q_DECLARE_LOGGING_CATEGORY(lcJs); - /*! \internal diff --git a/src/qml/qml/qqmlbuiltinfunctions.cpp b/src/qml/qml/qqmlbuiltinfunctions.cpp index bc5d87881b..e31da345ee 100644 --- a/src/qml/qml/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/qqmlbuiltinfunctions.cpp @@ -35,7 +35,7 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcRootProperties, "qt.qml.rootObjectProperties"); +Q_STATIC_LOGGING_CATEGORY(lcRootProperties, "qt.qml.rootObjectProperties"); Q_LOGGING_CATEGORY(lcQml, "qml"); Q_LOGGING_CATEGORY(lcJs, "js"); diff --git a/src/qml/qml/qqmlbuiltinfunctions_p.h b/src/qml/qml/qqmlbuiltinfunctions_p.h index c2732e1aff..8d1cc75cb1 100644 --- a/src/qml/qml/qqmlbuiltinfunctions_p.h +++ b/src/qml/qml/qqmlbuiltinfunctions_p.h @@ -31,6 +31,9 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcQml); +Q_DECLARE_LOGGING_CATEGORY(lcJs); + class Q_QML_EXPORT QtObject : public QObject { Q_OBJECT diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index e063418de4..685b5cc62f 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -36,7 +36,7 @@ namespace { Q_CONSTINIT thread_local int creationDepth = 0; } -Q_LOGGING_CATEGORY(lcQmlComponentGeneral, "qt.qml.qmlcomponent") +Q_STATIC_LOGGING_CATEGORY(lcQmlComponentGeneral, "qt.qml.qmlcomponent") QT_BEGIN_NAMESPACE diff --git a/src/qml/qml/qqmldatablob.cpp b/src/qml/qml/qqmldatablob.cpp index 6b354c337f..0a520d5864 100644 --- a/src/qml/qml/qqmldatablob.cpp +++ b/src/qml/qml/qqmldatablob.cpp @@ -4,9 +4,10 @@ #include <private/qqmldatablob_p.h> #include <private/qqmlglobal_p.h> #include <private/qqmlprofiler_p.h> +#include <private/qqmlsourcecoordinate_p.h> +#include <private/qqmltypedata_p.h> #include <private/qqmltypeloader_p.h> #include <private/qqmltypeloaderthread_p.h> -#include <private/qqmlsourcecoordinate_p.h> #include <QtQml/qqmlengine.h> @@ -20,8 +21,6 @@ DEFINE_BOOL_CONFIG_OPTION(dumpErrors, QML_DUMP_ERRORS); -Q_DECLARE_LOGGING_CATEGORY(lcCycle) - QT_BEGIN_NAMESPACE /*! diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 1175bde3db..f53aa2c28a 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -6,6 +6,7 @@ #include <private/qqmlextensionplugin_p.h> #include <private/qqmlmetatypedata_p.h> #include <private/qqmlpropertycachecreator_p.h> +#include <private/qqmlscriptblob_p.h> #include <private/qqmltype_p_p.h> #include <private/qqmltypeloader_p.h> #include <private/qqmltypemodule_p.h> @@ -16,8 +17,7 @@ #include <QtCore/qmutex.h> #include <QtCore/qloggingcategory.h> -Q_DECLARE_LOGGING_CATEGORY(DBG_DISK_CACHE) -Q_LOGGING_CATEGORY(lcTypeRegistration, "qt.qml.typeregistration") +Q_STATIC_LOGGING_CATEGORY(lcTypeRegistration, "qt.qml.typeregistration") QT_BEGIN_NAMESPACE diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index a9b9140390..cc019949de 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -34,7 +34,7 @@ #include <QScopedValueRollback> #include <QLoggingCategory> -Q_LOGGING_CATEGORY(lcQmlDefaultMethod, "qt.qml.defaultmethod") +Q_STATIC_LOGGING_CATEGORY(lcQmlDefaultMethod, "qt.qml.defaultmethod") QT_USE_NAMESPACE diff --git a/src/qml/qml/qqmlpropertybinding.cpp b/src/qml/qml/qqmlpropertybinding.cpp index c8a7e6256a..35fd9c5963 100644 --- a/src/qml/qml/qqmlpropertybinding.cpp +++ b/src/qml/qml/qqmlpropertybinding.cpp @@ -18,7 +18,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::Literals::StringLiterals; -Q_LOGGING_CATEGORY(lcQQPropertyBinding, "qt.qml.propertybinding"); +Q_STATIC_LOGGING_CATEGORY(lcQQPropertyBinding, "qt.qml.propertybinding"); QUntypedPropertyBinding QQmlPropertyBinding::create(const QQmlPropertyData *pd, QV4::Function *function, QObject *obj, const QQmlRefPointer<QQmlContextData> &ctxt, diff --git a/src/qml/qml/qqmlscriptblob.cpp b/src/qml/qml/qqmlscriptblob.cpp index fa9a41e801..5f29cd25a9 100644 --- a/src/qml/qml/qqmlscriptblob.cpp +++ b/src/qml/qml/qqmlscriptblob.cpp @@ -12,11 +12,10 @@ #include <QtCore/qloggingcategory.h> -Q_DECLARE_LOGGING_CATEGORY(DBG_DISK_CACHE) -Q_LOGGING_CATEGORY(DBG_DISK_CACHE, "qt.qml.diskcache") - QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(DBG_DISK_CACHE, "qt.qml.diskcache") + QQmlScriptBlob::QQmlScriptBlob(const QUrl &url, QQmlTypeLoader *loader) : QQmlTypeLoader::Blob(url, JavaScriptFile, loader) , m_isModule(url.path().endsWith(QLatin1String(".mjs"))) diff --git a/src/qml/qml/qqmlscriptblob_p.h b/src/qml/qml/qqmlscriptblob_p.h index 59f969859b..9abc843de3 100644 --- a/src/qml/qml/qqmlscriptblob_p.h +++ b/src/qml/qml/qqmlscriptblob_p.h @@ -18,6 +18,7 @@ #include <private/qqmltypeloader_p.h> QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(DBG_DISK_CACHE) class QQmlScriptData; class Q_AUTOTEST_EXPORT QQmlScriptBlob : public QQmlTypeLoader::Blob diff --git a/src/qml/qml/qqmltypedata.cpp b/src/qml/qml/qqmltypedata.cpp index 2b189cd264..7ff6a4fc94 100644 --- a/src/qml/qml/qqmltypedata.cpp +++ b/src/qml/qml/qqmltypedata.cpp @@ -18,11 +18,10 @@ #include <memory> -Q_DECLARE_LOGGING_CATEGORY(DBG_DISK_CACHE) -Q_LOGGING_CATEGORY(lcCycle, "qt.qml.typeresolution.cycle", QtWarningMsg) - QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcCycle, "qt.qml.typeresolution.cycle", QtWarningMsg) + QQmlTypeData::TypeDataCallback::~TypeDataCallback() { } diff --git a/src/qml/qml/qqmltypedata_p.h b/src/qml/qml/qqmltypedata_p.h index 97419b916b..436fef9b71 100644 --- a/src/qml/qml/qqmltypedata_p.h +++ b/src/qml/qml/qqmltypedata_p.h @@ -20,6 +20,8 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcCycle) + class Q_AUTOTEST_EXPORT QQmlTypeData : public QQmlTypeLoader::Blob { Q_DECLARE_TR_FUNCTIONS(QQmlTypeData) diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index a85601e5b9..21c5a76dd8 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -30,8 +30,6 @@ QT_BEGIN_NAMESPACE -Q_DECLARE_LOGGING_CATEGORY(lcBuiltinsBindingRemoval) - DEFINE_OBJECT_VTABLE(QV4::QQmlValueTypeWrapper); namespace QV4 { diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp index 5dcf89b863..6991d642f5 100644 --- a/src/qml/types/qqmlbind.cpp +++ b/src/qml/types/qqmlbind.cpp @@ -30,7 +30,7 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQtQmlBindingRemoval, "qt.qml.binding.removal", QtWarningMsg) +Q_STATIC_LOGGING_CATEGORY(lcQtQmlBindingRemoval, "qt.qml.binding.removal", QtWarningMsg) enum class QQmlBindEntryKind: quint8 { V4Value, diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp index 99541a64dc..710adc3efa 100644 --- a/src/qml/types/qqmlconnections.cpp +++ b/src/qml/types/qqmlconnections.cpp @@ -23,7 +23,7 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQmlConnections, "qt.qml.connections") +Q_STATIC_LOGGING_CATEGORY(lcQmlConnections, "qt.qml.connections") // This is the equivalent of QQmlBoundSignal for C++ methods as as slots. // If a type derived from QQmlConnnections is compiled using qmltc, the diff --git a/src/qmlcompiler/qqmljstyperesolver.cpp b/src/qmlcompiler/qqmljstyperesolver.cpp index 491c87388d..0c22fc2814 100644 --- a/src/qmlcompiler/qqmljstyperesolver.cpp +++ b/src/qmlcompiler/qqmljstyperesolver.cpp @@ -17,7 +17,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -Q_LOGGING_CATEGORY(lcTypeResolver, "qt.qml.compiler.typeresolver", QtInfoMsg); +Q_STATIC_LOGGING_CATEGORY(lcTypeResolver, "qt.qml.compiler.typeresolver", QtInfoMsg); static inline void assertExtension(const QQmlJSScope::ConstPtr &type, QLatin1String extension) { diff --git a/src/qmlls/qqmlcodemodel.cpp b/src/qmlls/qqmlcodemodel.cpp index e3a6315e6f..cf58fba760 100644 --- a/src/qmlls/qqmlcodemodel.cpp +++ b/src/qmlls/qqmlcodemodel.cpp @@ -21,7 +21,7 @@ QT_BEGIN_NAMESPACE namespace QmlLsp { -Q_LOGGING_CATEGORY(codeModelLog, "qt.languageserver.codemodel") +Q_STATIC_LOGGING_CATEGORY(codeModelLog, "qt.languageserver.codemodel") using namespace QQmlJS::Dom; using namespace Qt::StringLiterals; diff --git a/src/qmlls/qqmlformatting_p.h b/src/qmlls/qqmlformatting_p.h index 465a32e31d..19fc30683e 100644 --- a/src/qmlls/qqmlformatting_p.h +++ b/src/qmlls/qqmlformatting_p.h @@ -21,6 +21,8 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(formatLog) + struct DocumentFormattingRequest : public BaseRequest<QLspSpecification::DocumentFormattingParams, QLspSpecification::Responses::DocumentFormattingResponseType> diff --git a/src/qmlls/qqmlrangeformatting.cpp b/src/qmlls/qqmlrangeformatting.cpp index 1bcabc190d..fab8260d6b 100644 --- a/src/qmlls/qqmlrangeformatting.cpp +++ b/src/qmlls/qqmlrangeformatting.cpp @@ -14,8 +14,6 @@ QT_BEGIN_NAMESPACE -Q_DECLARE_LOGGING_CATEGORY(formatLog) - QQmlRangeFormatting::QQmlRangeFormatting(QmlLsp::QQmlCodeModel *codeModel) : QQmlBaseModule(codeModel) { |
