Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmljsloggingutils.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QQMLJSLOGGER_H
5#define QQMLJSLOGGER_H
6
7#include <QtCore/QFileInfo>
8#include <qtqmlcompilerexports.h>
9
11
12class QQmlJSLoggerPrivate;
13class QQmlJSScope;
14
15namespace QQmlSA {
16class SourceLocation;
17}
18
19namespace QQmlJS {
20class LoggerCategoryPrivate;
21
22class Q_QMLCOMPILER_EXPORT LoggerWarningId
23{
24public:
25 constexpr LoggerWarningId(QAnyStringView name) : m_name(name) { }
26
27 const QAnyStringView name() const { return m_name; }
28
29private:
30 friend bool operator==(const LoggerWarningId &a, const LoggerWarningId &b)
31 {
32 return a.m_name == b.m_name;
33 }
34
35 friend bool operator!=(const LoggerWarningId &a, const LoggerWarningId &b)
36 {
37 return a.m_name != b.m_name;
38 }
39 const QAnyStringView m_name;
40};
41
42class Q_QMLCOMPILER_EXPORT LoggerCategory
43{
44 Q_DECLARE_PRIVATE(LoggerCategory)
45
46public:
48 LoggerCategory(QString name, QString settingsName, QString description, QtMsgType level,
49 bool ignored = false, bool isDefault = false);
52 LoggerCategory &operator=(const LoggerCategory &);
53 LoggerCategory &operator=(LoggerCategory &&) noexcept;
55
56 QString name() const;
57 QString settingsName() const;
58 QString description() const;
59 QtMsgType level() const;
60 bool isIgnored() const;
61 bool isDefault() const;
62
63 LoggerWarningId id() const;
64
65 void setLevel(QtMsgType);
66 void setIgnored(bool);
67
68 friend bool operator==(const LoggerCategory &category, const LoggerWarningId &warningId)
69 {
70 return category.name() == warningId.name();
71 }
72
73private:
74 std::unique_ptr<QQmlJS::LoggerCategoryPrivate> d_ptr;
75};
76
77} // namespace QQmlJS
78
79extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlRequired;
80extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnresolvedAlias;
81extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlAliasCycle;
82extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlImport;
83extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlRecursionDepthErrors;
84extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlWith;
85extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlInheritanceCycle;
86extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDeprecated;
87extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSignalParameters;
88extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMissingType;
89extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnresolvedType;
90extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlIncompatibleType;
91extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMissingProperty;
92extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlRestrictedType;
93extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlPrefixedImportType;
94extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlNonListProperty;
95extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlReadOnlyProperty;
96extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDuplicatePropertyBinding;
97extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDuplicatedName;
98extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDeferredPropertyId;
99extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnqualified;
100extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnusedImports;
101extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMultilineStrings;
102extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSyntax;
103extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSyntaxIdQuotation;
104extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSyntaxDuplicateIds;
105extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlCompiler;
106extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlAttachedPropertyReuse;
107extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlPlugin;
108extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlVarUsedBeforeDeclaration;
109extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlInvalidLintDirective;
110extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUseProperFunction;
111extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlAccessSingleton;
112extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlTopLevelComponent;
113extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUncreatableType;
114extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMissingEnumEntry;
115
117
118#endif // QQMLJSLOGGER_H
\inmodule QtCore
Tracks the types for the QmlCompiler.
LoggerCategory(LoggerCategory &&) noexcept
constexpr LoggerWarningId(QAnyStringView name)
const QAnyStringView name() const
friend bool operator==(const LoggerWarningId &a, const LoggerWarningId &b)
friend bool operator!=(const LoggerWarningId &a, const LoggerWarningId &b)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
const QLoggingCategory & category()
[1]
\inmodule QtQmlCompiler
Combined button and popup list for selecting options.
QtMsgType
Definition qlogging.h:29
GLboolean GLboolean GLboolean b
GLenum GLuint GLint level
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint name
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlVarUsedBeforeDeclaration
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSyntaxIdQuotation
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlPrefixedImportType
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlCompiler
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlImport
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSignalParameters
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlTopLevelComponent
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlPlugin
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlReadOnlyProperty
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnusedImports
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlInvalidLintDirective
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlRequired
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDeferredPropertyId
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlRecursionDepthErrors
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlRestrictedType
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlInheritanceCycle
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUncreatableType
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDuplicatedName
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlIncompatibleType
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSyntaxDuplicateIds
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnresolvedAlias
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnqualified
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMissingProperty
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlSyntax
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDuplicatePropertyBinding
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlAttachedPropertyReuse
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUnresolvedType
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlUseProperFunction
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlNonListProperty
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMissingType
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlAliasCycle
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMultilineStrings
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlMissingEnumEntry
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlAccessSingleton
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlDeprecated
const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlWith