Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQmlJSLogger Class Reference

#include <qqmljslogger_p.h>

+ Collaboration diagram for QQmlJSLogger:

Public Member Functions

QList< QQmlJS::LoggerCategorycategories () const
 
void registerCategory (const QQmlJS::LoggerCategory &category)
 
 QQmlJSLogger ()
 
 ~QQmlJSLogger ()=default
 
bool hasWarnings () const
 
bool hasErrors () const
 
const QList< Message > & infos () const
 
const QList< Message > & warnings () const
 
const QList< Message > & errors () const
 
QtMsgType categoryLevel (QQmlJS::LoggerWarningId id) const
 
void setCategoryLevel (QQmlJS::LoggerWarningId id, QtMsgType level)
 
bool isCategoryIgnored (QQmlJS::LoggerWarningId id) const
 
void setCategoryIgnored (QQmlJS::LoggerWarningId id, bool error)
 
bool isCategoryFatal (QQmlJS::LoggerWarningId id) const
 
void setCategoryFatal (QQmlJS::LoggerWarningId id, bool error)
 
bool wasCategoryChanged (QQmlJS::LoggerWarningId id) const
 
void log (const QString &message, QQmlJS::LoggerWarningId id, const QQmlJS::SourceLocation &srcLocation, bool showContext=true, bool showFileName=true, const std::optional< QQmlJSFixSuggestion > &suggestion={}, const QString overrideFileName=QString())
 
void processMessages (const QList< QQmlJS::DiagnosticMessage > &messages, const QQmlJS::LoggerWarningId id)
 
void ignoreWarnings (uint32_t line, const QSet< QString > &categories)
 
void setSilent (bool silent)
 
bool isSilent () const
 
void setCode (const QString &code)
 
QString code () const
 
void setFileName (const QString &fileName)
 
QString fileName () const
 

Static Public Member Functions

static const QList< QQmlJS::LoggerCategory > & defaultCategories ()
 

Friends

class QQmlJSAotCompiler
 

Detailed Description

Definition at line 114 of file qqmljslogger_p.h.

Constructor & Destructor Documentation

◆ QQmlJSLogger()

QQmlJSLogger::QQmlJSLogger ( )

Definition at line 65 of file qqmljslogger.cpp.

References QColorOutput::BlueForeground, category(), defaultCategories(), QColorOutput::GreenForeground, QColorOutput::insertMapping(), QColorOutput::PurpleForeground, QtCriticalMsg, QtDebugMsg, QtInfoMsg, QtWarningMsg, QColorOutput::RedForeground, and registerCategory().

+ Here is the call graph for this function:

◆ ~QQmlJSLogger()

QQmlJSLogger::~QQmlJSLogger ( )
default

Member Function Documentation

◆ categories()

QList< QQmlJS::LoggerCategory > QQmlJSLogger::categories ( ) const

Definition at line 208 of file qqmljslogger.cpp.

References QMap< Key, T >::values().

+ Here is the call graph for this function:

◆ categoryLevel()

QtMsgType QQmlJSLogger::categoryLevel ( QQmlJS::LoggerWarningId id) const
inline

Definition at line 133 of file qqmljslogger_p.h.

◆ code()

QString QQmlJSLogger::code ( ) const
inline

Definition at line 196 of file qqmljslogger_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ defaultCategories()

◆ errors()

const QList< Message > & QQmlJSLogger::errors ( ) const
inline

Definition at line 131 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::applyFixes().

+ Here is the caller graph for this function:

◆ fileName()

QString QQmlJSLogger::fileName ( ) const
inline

Definition at line 199 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::applyFixes(), and QQmlJSLinter::lintFile().

+ Here is the caller graph for this function:

◆ hasErrors()

bool QQmlJSLogger::hasErrors ( ) const
inline

Definition at line 127 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::lintFile(), and QQmlJSLinter::lintModule().

+ Here is the caller graph for this function:

◆ hasWarnings()

bool QQmlJSLogger::hasWarnings ( ) const
inline

Definition at line 126 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::lintFile(), and QQmlJSLinter::lintModule().

+ Here is the caller graph for this function:

◆ ignoreWarnings()

void QQmlJSLogger::ignoreWarnings ( uint32_t line,
const QSet< QString > & categories )
inline

Definition at line 187 of file qqmljslogger_p.h.

References line.

◆ infos()

const QList< Message > & QQmlJSLogger::infos ( ) const
inline

Definition at line 129 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::applyFixes().

+ Here is the caller graph for this function:

◆ isCategoryFatal()

bool QQmlJSLogger::isCategoryFatal ( QQmlJS::LoggerWarningId id) const
inline

Definition at line 153 of file qqmljslogger_p.h.

Referenced by QQmlJSAotCompiler::diagnose().

+ Here is the caller graph for this function:

◆ isCategoryIgnored()

bool QQmlJSLogger::isCategoryIgnored ( QQmlJS::LoggerWarningId id) const
inline

Definition at line 143 of file qqmljslogger_p.h.

Referenced by processMessages().

+ Here is the caller graph for this function:

◆ isSilent()

bool QQmlJSLogger::isSilent ( ) const
inline

Definition at line 193 of file qqmljslogger_p.h.

◆ log()

void QQmlJSLogger::log ( const QString & message,
QQmlJS::LoggerWarningId id,
const QQmlJS::SourceLocation & srcLocation,
bool showContext = true,
bool showFileName = true,
const std::optional< QQmlJSFixSuggestion > & suggestion = {},
const QString overrideFileName = QString() )
inline

Logs message with severity deduced from category. Prefer using this function in most cases.

See also
setCategoryLevel

Definition at line 175 of file qqmljslogger_p.h.

Referenced by QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSImportVisitor::checkDeprecation(), QQmlJSTypePropagator::checkForEnumProblems(), QQmlJSImportVisitor::checkGroupedAndAttachedScopes(), QQmlJSImportVisitor::checkRequiredProperties(), QQmlJSAotCompiler::diagnose(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSTypePropagator::generate_Ret(), QQmlJSTypePropagator::generate_StoreNameCommon(), QQmlJSTypePropagator::generate_StoreProperty(), QQmlJSTypeResolver::genericType(), QQmlJSImportVisitor::isTypeResolved(), QQmlJSLinter::lintFile(), QQmlJSLinter::lintModule(), logLowerCaseImport(), QQmlJSTypeResolver::memberType(), QQmlJSTypeResolver::memberType(), QQmlJSImportVisitor::processDefaultProperties(), processMessages(), QQmlJSImportVisitor::processMethodTypes(), QQmlJSImportVisitor::processPropertyBindingObjects(), QQmlJSImportVisitor::processPropertyBindings(), QQmlJSImportVisitor::processPropertyTypes(), QQmlJSTypeResolver::registerContentForName(), CodegenWarningInterface::reportVarUsedBeforeDeclaration(), QQmlJSImportVisitor::setAllBindings(), QQmlJSImportVisitor::throwRecursionDepthError(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ processMessages()

void QQmlJSLogger::processMessages ( const QList< QQmlJS::DiagnosticMessage > & messages,
const QQmlJS::LoggerWarningId id )

Definition at line 292 of file qqmljslogger.cpp.

References isCategoryIgnored(), log(), QStringLiteral, and QColorOutput::write().

Referenced by QQmlJSLinter::lintFile(), and QQmlJSLinter::lintModule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerCategory()

void QQmlJSLogger::registerCategory ( const QQmlJS::LoggerCategory & category)

Definition at line 213 of file qqmljslogger.cpp.

References category(), QMap< Key, T >::contains(), QMap< Key, T >::insert(), and qWarning.

Referenced by QQmlJSLogger(), and QQmlJSLinter::lintFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCategoryFatal()

void QQmlJSLogger::setCategoryFatal ( QQmlJS::LoggerWarningId id,
bool error )
inline

Definition at line 157 of file qqmljslogger_p.h.

References error.

◆ setCategoryIgnored()

void QQmlJSLogger::setCategoryIgnored ( QQmlJS::LoggerWarningId id,
bool error )
inline

Definition at line 147 of file qqmljslogger_p.h.

References error.

Referenced by QQmlJSLinter::lintFile(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setCategoryLevel()

void QQmlJSLogger::setCategoryLevel ( QQmlJS::LoggerWarningId id,
QtMsgType level )
inline

Definition at line 137 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::lintFile(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setCode()

void QQmlJSLogger::setCode ( const QString & code)
inline

Definition at line 195 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::lintFile(), QQmlJSLinter::lintModule(), QQmlJSTypeReader::operator()(), and QQmlJSAotCompiler::setDocument().

+ Here is the caller graph for this function:

◆ setFileName()

void QQmlJSLogger::setFileName ( const QString & fileName)
inline

Definition at line 198 of file qqmljslogger_p.h.

References fileName.

Referenced by QQmlJSLinter::lintFile(), QQmlJSLinter::lintModule(), QQmlJSTypeReader::operator()(), QQmlJS::Dom::DomEnvironment::populateFromQmlFile(), and QQmlJSAotCompiler::setDocument().

+ Here is the caller graph for this function:

◆ setSilent()

void QQmlJSLogger::setSilent ( bool silent)
inline

Definition at line 192 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::lintFile(), QQmlJSLinter::lintModule(), and QQmlJSTypeReader::operator()().

+ Here is the caller graph for this function:

◆ warnings()

const QList< Message > & QQmlJSLogger::warnings ( ) const
inline

Definition at line 130 of file qqmljslogger_p.h.

Referenced by QQmlJSLinter::applyFixes().

+ Here is the caller graph for this function:

◆ wasCategoryChanged()

bool QQmlJSLogger::wasCategoryChanged ( QQmlJS::LoggerWarningId id) const
inline

Definition at line 163 of file qqmljslogger_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QQmlJSAotCompiler

friend class QQmlJSAotCompiler
friend

Definition at line 232 of file qqmljslogger_p.h.


The documentation for this class was generated from the following files: