#include <qqmljslogger_p.h>
|
QList< QQmlJS::LoggerCategory > | categories () const |
void | registerCategory (const QQmlJS::LoggerCategory &category) |
| QQmlJSLogger () |
| ~QQmlJSLogger ()=default |
bool | hasWarnings () const |
bool | hasErrors () const |
qsizetype | numWarnings () const |
qsizetype | numErrors () const |
template<typename F> |
void | iterateCurrentFunctionMessages (F &&f) const |
template<typename F> |
void | iterateAllMessages (F &&f) 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 |
QtMsgType | compileErrorLevel () const |
void | setCompileErrorLevel (QtMsgType level) |
QString | compileErrorPrefix () const |
void | setCompileErrorPrefix (const QString &prefix) |
QString | compileSkipPrefix () const |
void | setCompileSkipPrefix (const QString &prefix) |
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(), std::optional< quint32 > customLineForDisabling=std::nullopt) |
void | logCompileError (const QString &message, const QQmlJS::SourceLocation &srcLocation) |
void | logCompileSkip (const QString &message, const QQmlJS::SourceLocation &srcLocation) |
void | processMessages (const QList< QQmlJS::DiagnosticMessage > &messages, const QQmlJS::LoggerWarningId id, const QQmlJS::SourceLocation &sourceLocation=QQmlJS::SourceLocation{}) |
void | ignoreWarnings (uint32_t line, const QSet< QString > &categories) |
void | setSilent (bool silent) |
bool | isSilent () const |
void | setIsDisabled (bool isDisabled) |
bool | isDisabled () const |
void | setCode (const QString &code) |
QString | code () const |
void | setFilePath (const QString &filePath) |
QString | filePath () const |
bool | currentFunctionHasCompileError () const |
bool | currentFunctionWasSkipped () const |
bool | currentFunctionHasErrorOrSkip () const |
QString | currentFunctionCompileErrorMessage () const |
QString | currentFunctionCompileSkipMessage () const |
void | startTransaction () |
void | commit () |
void | rollback () |
void | finalizeFuction () |
Definition at line 121 of file qqmljslogger_p.h.
◆ QQmlJSLogger()
QQmlJSLogger::QQmlJSLogger |
( |
| ) |
|
◆ ~QQmlJSLogger()
QQmlJSLogger::~QQmlJSLogger |
( |
| ) |
|
|
default |
◆ categories()
◆ categoryLevel()
◆ code()
QString QQmlJSLogger::code |
( |
| ) |
const |
|
inline |
◆ commit()
void QQmlJSLogger::commit |
( |
| ) |
|
Commit the current transaction. Print all pending messages, and add them to the list of committed messages. Then, clear the transaction flag.
Definition at line 375 of file qqmljslogger.cpp.
◆ compileErrorLevel()
QtMsgType QQmlJSLogger::compileErrorLevel |
( |
| ) |
const |
|
inline |
◆ compileErrorPrefix()
QString QQmlJSLogger::compileErrorPrefix |
( |
| ) |
const |
|
inline |
◆ compileSkipPrefix()
QString QQmlJSLogger::compileSkipPrefix |
( |
| ) |
const |
|
inline |
◆ currentFunctionCompileErrorMessage()
QString QQmlJSLogger::currentFunctionCompileErrorMessage |
( |
| ) |
const |
|
inline |
◆ currentFunctionCompileSkipMessage()
QString QQmlJSLogger::currentFunctionCompileSkipMessage |
( |
| ) |
const |
|
inline |
◆ currentFunctionHasCompileError()
bool QQmlJSLogger::currentFunctionHasCompileError |
( |
| ) |
const |
|
inline |
◆ currentFunctionHasErrorOrSkip()
bool QQmlJSLogger::currentFunctionHasErrorOrSkip |
( |
| ) |
const |
|
inline |
◆ currentFunctionWasSkipped()
bool QQmlJSLogger::currentFunctionWasSkipped |
( |
| ) |
const |
|
inline |
◆ defaultCategories()
◆ filePath()
QString QQmlJSLogger::filePath |
( |
| ) |
const |
|
inline |
◆ finalizeFuction()
void QQmlJSLogger::finalizeFuction |
( |
| ) |
|
◆ hasErrors()
bool QQmlJSLogger::hasErrors |
( |
| ) |
const |
|
inline |
◆ hasWarnings()
bool QQmlJSLogger::hasWarnings |
( |
| ) |
const |
|
inline |
◆ ignoreWarnings()
void QQmlJSLogger::ignoreWarnings |
( |
uint32_t | line, |
|
|
const QSet< QString > & | categories ) |
|
inline |
◆ isCategoryFatal()
◆ isCategoryIgnored()
◆ isDisabled()
bool QQmlJSLogger::isDisabled |
( |
| ) |
const |
|
inline |
◆ isSilent()
bool QQmlJSLogger::isSilent |
( |
| ) |
const |
|
inline |
◆ iterateAllMessages()
void QQmlJSLogger::iterateAllMessages |
( |
F && | f | ) |
const |
|
inline |
◆ iterateCurrentFunctionMessages()
void QQmlJSLogger::iterateCurrentFunctionMessages |
( |
F && | f | ) |
const |
|
inline |
◆ log()
◆ logCompileError()
◆ logCompileSkip()
◆ numErrors()
◆ numWarnings()
qsizetype QQmlJSLogger::numWarnings |
( |
| ) |
const |
|
inline |
◆ processMessages()
◆ registerCategory()
◆ rollback()
void QQmlJSLogger::rollback |
( |
| ) |
|
Roll back the current transaction and revert the logger to the state before it was started.
Definition at line 392 of file qqmljslogger.cpp.
◆ setCategoryFatal()
◆ setCategoryIgnored()
◆ setCategoryLevel()
◆ setCode()
◆ setCompileErrorLevel()
◆ setCompileErrorPrefix()
void QQmlJSLogger::setCompileErrorPrefix |
( |
const QString & | prefix | ) |
|
|
inline |
◆ setCompileSkipPrefix()
void QQmlJSLogger::setCompileSkipPrefix |
( |
const QString & | prefix | ) |
|
|
inline |
◆ setFilePath()
void QQmlJSLogger::setFilePath |
( |
const QString & | filePath | ) |
|
|
inline |
◆ setIsDisabled()
void QQmlJSLogger::setIsDisabled |
( |
bool | isDisabled | ) |
|
|
inline |
The logger is disabled when warnings are not relevant, for example when the import visitor runs on a dependency of a linted file. In that case, the warnings should not be created, and expensive QQmlJSUtils::didYouMean call can be saved.
setSilent() has a different behavior: a silent logger can still be used to process messages as JSON, for example, while a disabled logger won't contain any message.
Definition at line 282 of file qqmljslogger_p.h.
◆ setSilent()
void QQmlJSLogger::setSilent |
( |
bool | silent | ) |
|
|
inline |
◆ startTransaction()
void QQmlJSLogger::startTransaction |
( |
| ) |
|
Starts a transaction for a compile pass. This buffers all messages until the transaction completes. If you commit the transaction, the messages are printed and added to the list of committed messages. If you roll it back, the logger reverts to the state before the start of the transaction.
This is useful for compile passes that potentially have to be repeated, such as the type propagator. We don't want to see the same messages logged multiple times.
Definition at line 364 of file qqmljslogger.cpp.
◆ wasCategoryChanged()
The documentation for this class was generated from the following files: