mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-09 14:31:17 +00:00
add timestamp to compact format
This commit is contained in:
parent
4486c12df5
commit
77e9e3a317
@ -4,6 +4,7 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -35,7 +36,7 @@ public class CompactRenderer extends ValidationOutputRenderer {
|
||||
}
|
||||
|
||||
private void render(PrintStream d, OperationOutcome op) {
|
||||
d.println(ToolingExtensions.readStringExtension(op, ToolingExtensions.EXT_OO_FILE));
|
||||
d.println(ToolingExtensions.readStringExtension(op, ToolingExtensions.EXT_OO_FILE)+" "+getRunDate());
|
||||
List<String> lines = new ArrayList<>();
|
||||
for (OperationOutcome.OperationOutcomeIssueComponent issue : op.getIssue()) {
|
||||
String path = issue.hasExpression() ? issue.getExpression().get(0).asStringValue() : "n/a";
|
||||
|
@ -9,6 +9,7 @@ import org.hl7.fhir.r5.model.OperationOutcome;
|
||||
|
||||
public abstract class ValidationOutputRenderer {
|
||||
|
||||
private String runDate;
|
||||
protected boolean crumbTrails;
|
||||
protected boolean moreThanOne;
|
||||
protected PrintStream dst;
|
||||
@ -21,6 +22,14 @@ public abstract class ValidationOutputRenderer {
|
||||
this.crumbTrails = crumbTrails;
|
||||
}
|
||||
|
||||
public String getRunDate() {
|
||||
return runDate;
|
||||
}
|
||||
|
||||
public void setRunDate(String runDate) {
|
||||
this.runDate = runDate;
|
||||
}
|
||||
|
||||
public void start(boolean moreThanOne) {
|
||||
this.moreThanOne = moreThanOne;
|
||||
}
|
||||
|
@ -5,8 +5,11 @@ import java.io.FileOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryMXBean;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.hl7.fhir.r5.conformance.R5ExtensionsLoader;
|
||||
import org.hl7.fhir.r5.context.ContextUtilities;
|
||||
@ -59,9 +62,11 @@ import org.hl7.fhir.validation.cli.utils.VersionSourceInformation;
|
||||
public class ValidationService {
|
||||
|
||||
private final SessionCache sessionCache;
|
||||
private String runDate;
|
||||
|
||||
public ValidationService() {
|
||||
sessionCache = new SessionCache();
|
||||
runDate = new SimpleDateFormat("hh:mm:ss", new Locale("en", "US")).format(new Date());
|
||||
}
|
||||
|
||||
protected ValidationService(SessionCache cache) {
|
||||
@ -123,6 +128,7 @@ public class ValidationService {
|
||||
PrintStream dst = null;
|
||||
ValidationOutputRenderer renderer = makeValidationOutputRenderer(cliContext);
|
||||
renderer.setCrumbTrails(validator.isCrumbTrails());
|
||||
renderer.setRunDate(runDate);
|
||||
if (renderer.isSingleFile()) {
|
||||
if (cliContext.getOutput() == null) {
|
||||
dst = System.out;
|
||||
|
Loading…
x
Reference in New Issue
Block a user