Skip to content

Commit

Permalink
Reduce verbosity on errors, with an env var as a switch (#54)
Browse files Browse the repository at this point in the history
* Reduce verbosity on errors, with an env var as a switch

The CI logs for KDSoap were huge because of one element not found
in a unittest (possibly to the point of the Windows CI timing out)

* clang-format formatting fix
  • Loading branch information
dfaure-kdab authored Dec 27, 2022
1 parent 5013867 commit 425ff91
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions schema/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,12 @@ bool Parser::resolveForwardDeclarations()
qWarning("ERROR in %s: resolving element ref to '%s': not found!",
qPrintable(complexType.qualifiedName().qname()),
qPrintable(element.reference().qname()));
d->mElements.dump();
if (qEnvironmentVariableIsSet("LIBKODE_VERBOSE_ERRORS")) {
d->mElements.dump();
} else {
qWarning() << "Set the environment variable LIBKODE_VERBOSE_ERRORS to see "
"the list of all available elements";
}
return false;
} else {
resolvedElement.setMinOccurs(element.minOccurs());
Expand Down Expand Up @@ -1340,7 +1345,12 @@ bool Parser::resolveForwardDeclarations()
qWarning("ERROR in %s: resolving attribute ref to '%s': not found!",
qPrintable(d->mComplexTypes[i].qualifiedName().qname()),
qPrintable(attribute.reference().qname()));
d->mAttributes.dump();
if (qEnvironmentVariableIsSet("LIBKODE_VERBOSE_ERRORS")) {
d->mAttributes.dump();
} else {
qWarning() << "Set the environment variable LIBKODE_VERBOSE_ERRORS to see "
"the list of all available attributes";
}
return false;
} else {
attributes[j] = refAttribute;
Expand Down

0 comments on commit 425ff91

Please sign in to comment.