aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-04-16 15:37:17 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-04-28 07:25:39 +0200
commite0c284cde3c4701517115f95f09e76181090c6a6 (patch)
tree54854ff04e9e2cea7b41e6b7a5942f6203233e83 /sources
parent76fb7e1657a106771390ece98a09956e10bda391 (diff)
shiboken: Change most debug messages to use qCInfo
A a check for the verbose level where missing, improve the formatting and use qCInfo. Adjust some levels. As an exception, leave the actual code model DOM dump within qCDebug. Task-number: PYSIDE-1265 Change-Id: I7d1d8015a35a543ae0b58ad9e3667ecdb741ce82 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp15
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp4
-rw-r--r--sources/shiboken2/ApiExtractor/apiextractor.cpp9
-rw-r--r--sources/shiboken2/ApiExtractor/typesystemparser.cpp4
-rw-r--r--sources/shiboken2/generator/main.cpp10
5 files changed, 27 insertions, 15 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index 487b5f399..f16a142b3 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -1053,11 +1053,11 @@ AbstractMetaClass *AbstractMetaBuilderPrivate::traverseClass(const FileModelItem
if (type->stream())
metaClass->setStream(true);
- if (ReportHandler::isDebug(ReportHandler::SparseDebug)) {
+ if (ReportHandler::isDebug(ReportHandler::MediumDebug)) {
const QString message = type->isContainer()
? QStringLiteral("container: '%1'").arg(fullClassName)
: QStringLiteral("class: '%1'").arg(metaClass->fullName());
- qCDebug(lcShiboken) << message;
+ qCInfo(lcShiboken, "%s", qPrintable(message));
}
TemplateParameterList template_parameters = classItem->templateParameters();
@@ -1745,11 +1745,14 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
const QString &signature = functionSignature(functionItem);
const bool rejected =
TypeDatabase::instance()->isFunctionRejected(className, signature, &rejectReason);
- qCDebug(lcShiboken).nospace().noquote() << __FUNCTION__
- << ": Checking rejection for signature \"" << signature << "\" for " << className
- << ": " << rejected;
- if (rejected)
+
+ if (rejected) {
+ if (ReportHandler::isDebug(ReportHandler::MediumDebug)) {
+ qCInfo(lcShiboken, "%s::%s was rejected by the type database (%s).",
+ qPrintable(className), qPrintable(signature), qPrintable(rejectReason));
+ }
return nullptr;
+ }
if (functionItem->isFriend())
return nullptr;
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index afa605493..1b2ee5568 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -816,8 +816,8 @@ bool AbstractMetaFunction::allowThread() const
result = false;
break;
}
- if (!result)
- qCDebug(lcShiboken).noquote() << msgDisallowThread(this);
+ if (!result && ReportHandler::isDebug(ReportHandler::MediumDebug))
+ qCInfo(lcShiboken).noquote() << msgDisallowThread(this);
return result;
}
diff --git a/sources/shiboken2/ApiExtractor/apiextractor.cpp b/sources/shiboken2/ApiExtractor/apiextractor.cpp
index 250fb7afd..6ca628c0a 100644
--- a/sources/shiboken2/ApiExtractor/apiextractor.cpp
+++ b/sources/shiboken2/ApiExtractor/apiextractor.cpp
@@ -207,8 +207,11 @@ bool ApiExtractor::run()
for (const HeaderPath &headerPath : qAsConst(m_includePaths))
arguments.append(HeaderPath::includeOption(headerPath));
arguments.append(QFile::encodeName(preprocessedCppFileName));
- qCDebug(lcShiboken) << __FUNCTION__ << arguments
- << "level=" << int(m_languageLevel);
+ if (ReportHandler::isDebug(ReportHandler::SparseDebug)) {
+ qCInfo(lcShiboken).noquote().nospace()
+ << "clang language level: " << int(m_languageLevel)
+ << "\nclang arguments: " << arguments;
+ }
const bool result = m_builder->build(arguments, m_languageLevel);
if (!result)
autoRemove = false;
@@ -250,6 +253,8 @@ QDebug operator<<(QDebug d, const ApiExtractor &ae)
QDebugStateSaver saver(d);
d.noquote();
d.nospace();
+ if (ReportHandler::debugLevel() >= ReportHandler::FullDebug)
+ d.setVerbosity(3); // Trigger verbose output of AbstractMetaClass
d << "ApiExtractor(typeSystem=\"" << ae.typeSystem() << "\", cppFileName=\""
<< ae.cppFileName() << ", ";
ae.m_builder->formatDebug(d);
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index 55b079edd..43a71a637 100644
--- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
@@ -2758,8 +2758,8 @@ bool TypeSystemParser::startElement(const QXmlStreamReader &reader)
m_currentDroppedEntry = element;
m_currentDroppedEntryDepth = 1;
if (ReportHandler::isDebug(ReportHandler::SparseDebug)) {
- qCDebug(lcShiboken)
- << QStringLiteral("Type system entry '%1' was intentionally dropped from generation.").arg(identifier);
+ qCInfo(lcShiboken, "Type system entry '%s' was intentionally dropped from generation.",
+ qPrintable(identifier));
}
return true;
}
diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp
index 02829d54b..841691484 100644
--- a/sources/shiboken2/generator/main.cpp
+++ b/sources/shiboken2/generator/main.cpp
@@ -388,7 +388,8 @@ int main(int argc, char *argv[])
// needed by qxmlpatterns
QCoreApplication app(argc, argv);
ReportHandler::install();
- qCDebug(lcShiboken()).noquote().nospace() << QCoreApplication::arguments().join(QLatin1Char(' '));
+ if (ReportHandler::isDebug(ReportHandler::SparseDebug))
+ qCInfo(lcShiboken()).noquote().nospace() << QCoreApplication::arguments().join(QLatin1Char(' '));
// Store command arguments in a map
CommandArgumentMap args = getCommandLineArgs();
@@ -616,8 +617,11 @@ int main(int argc, char *argv[])
if (!extractor.classCount())
qCWarning(lcShiboken) << "No C++ classes found!";
- qCDebug(lcShiboken) << extractor << '\n'
- << *TypeDatabase::instance();
+ if (ReportHandler::isDebug(ReportHandler::FullDebug)
+ || qEnvironmentVariableIsSet("SHIBOKEN_DUMP_CODEMODEL")) {
+ qCInfo(lcShiboken) << "API Extractor:\n" << extractor
+ << "\n\nType datase:\n" << *TypeDatabase::instance();
+ }
for (const GeneratorPtr &g : qAsConst(generators)) {
g->setOutputDirectory(outputDirectory);