cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
251 stars 121 forks source link

Remove exceptions printing stack traces #1290

Closed JPercival closed 7 months ago

JPercival commented 7 months ago

At various places in the CQL libraries Exceptions are caught and stack traces are printed such as here:

https://github.com/cqframework/clinical_quality_language/blob/master/Src/java/quick/src/main/java/org/cqframework/cql/cql2elm/quick/FhirModelInfoProvider.java#L69

For a core library included in other components, this bypasses whatever other logging mechanisms may be in place (such as slf4j, log4j, etc) and prints directly to the std error output stream. This means some diagnostic logging may be lost, and it also pollutes the output stream in cases where that's not desirable. For example, with the use of CLI tools.

We should remove all instances of Exception::printStackTrace() and either rethrow exceptions, log via a logging API, or ignore as appropriately.

The one exception to that rule is in the case where we're intentionally building a CLI.

JPercival commented 7 months ago

second exception to the rule: Test code. :)