-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh IG Group file POST addition & messaging improvements #506
Refresh IG Group file POST addition & messaging improvements #506
Conversation
Duplicate bundle files during refresh fixed. -x added as possible argument during Refresh IG to show expanded reporting for errors, warnings, and information messages. Bundle Test Cases enhanced with multithreading optimizations. General enhancements to message output for readability.
…o avoid possible duplicate keys
…rious methods during bundling process, to relay exception messages to uusers
…chicoine-icf/cqf-tooling into refresh-messaging-improvements
…ummary during refresh.
… abstract class. Finished message won't appear if no resources exist for bundling.
…and can cleanly report to measure developers the issues they have with tests.
…l post. Added ability to ignore certain tests during refresh.
…sage generation to its own method.
…r so that warnings from ca.uhn.fhir.parser.LenientErrorHandler can be supressed during various operations. We already handle the translator error list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes regarding use of log/Sysout. Very interesting to see a massive refactoring and the new functionalities being more explained.
outputResourceTracker.put(resourceFileLocation, Boolean.TRUE); | ||
|
||
} catch (IOException e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a log.error
); | ||
writer.flush(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here "log.error"
@@ -32,12 +40,6 @@ | |||
<artifactId>model-jackson</artifactId> | |||
</dependency> | |||
|
|||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we apply this change on the main pom.xml and do a refactoring of logger to complete this ticket : #333 @JPercival ?
@@ -76,8 +78,7 @@ public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encodin | |||
} | |||
|
|||
public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encoding outputEncoding, String libraryPath, String libraryOutputDirectory, Boolean versioned, FhirContext fhirContext, Boolean shouldApplySoftwareSystemStamp) { | |||
System.out.println("Refreshing libraries..."); | |||
// ArrayList<String> refreshedLibraryNames = new ArrayList<String>(); | |||
System.out.println("\r\n[Refreshing Libraries]\r\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to use logger here
|
||
logger.info("Refreshing measures..."); | ||
System.out.println("\r\n[Refreshing Measures]\r\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger might be better here.
@@ -250,7 +249,7 @@ public LibraryManager getLibraryManager() { | |||
} | |||
|
|||
private void translateFolder(String folder) { | |||
logger.logMessage(String.format("Translating CQL source in folder %s", folder)); | |||
System.out.printf("Translating CQL source in folder %s%n", folder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for logger with a String format that uses "folder"
@@ -343,7 +342,7 @@ public static ValidationMessage exceptionToValidationMessage(File file, CqlCompi | |||
} | |||
|
|||
private void translateFile(LibraryManager libraryManager, File file, CqlCompilerOptions options) { | |||
logger.logMessage(String.format("Translating CQL source in file %s", file.toString())); | |||
// logger.logMessage(String.format("Translating CQL source in file %s", file.toString())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated line
} catch (Exception ex) { | ||
logger.logMessage(String.format("CQL Translation succeeded for file: '%s', but ELM generation failed with the following error: %s", file.getAbsolutePath(), ex.getMessage())); | ||
} | ||
} | ||
|
||
//output Success/Warn/Info/Fail message to user: | ||
System.out.println(buildStatusMessage(translator.getErrors(), file.getName(), verboseMessaging)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger might be better here
|
||
//run collected post calls last: | ||
if (HttpClientUtils.hasPostTasksInQueue()) { | ||
System.out.println("\r\n[POST task(s) found in queue. POST task(s) started - " + getTime() + "]"); | ||
System.out.println("\r\n[Persisting Files to " + fhirUri + "]\r\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggesting use of logger here instead of System.out.println
@@ -172,105 +172,109 @@ public void testIg(TestIGParameters params) { | |||
|
|||
CqfmSoftwareSystem testTargetSoftwareSystem = getCqfRulerSoftwareSystem(params.fhirServerUri); | |||
|
|||
logger.info("Running IG test cases..."); | |||
System.out.println("\r\n[Running IG Test Cases]\r\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting use of logger here for this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The decision to use plain System.out.println came from trying to keep the console readable for the users. Logger includes a big time stamp for every entry and can clutter the console window while we try to convey useful information to the user as it all flies by.
If that sort of thing isn't as necessary as I previously thought I can revert these to use logger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log format can be configured, and it's possible to simultaneously have different formats for different targets. For example, simple output that's redirected to the CLI output, and verbose output/formatting going to a log file. That is a separate level of configuration that's needed, but routing messaging through the logger API allows that type of configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me! I'll go ahead and adjust this to use the logger and we can revisit cleaning up the format
Logger is now used over System.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request covers the following changes:
By creating this PR you acknowledge that your contribution will be licensed under Apache 2.0