Skip to content

Commit

Permalink
cleanup elton reporting format
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpoelen committed Sep 5, 2018
1 parent c62bd8c commit 28f8d20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eol.globi.service.DatasetFinder;
import org.eol.globi.service.DatasetFinderGitHubArchiveMaster;
import org.eol.globi.service.DatasetFinderProxy;
import org.eol.globi.util.CSVTSVUtil;
import org.globalbioticinteractions.elton.util.NodeFactoryNull;
import org.globalbioticinteractions.elton.util.SpecimenNull;

Expand Down Expand Up @@ -77,7 +78,7 @@ private void addUntilFull(String message, Set<String> msgs) {
}

String msgForRepo(String message) {
return "[" + repoName + "]: [" + message + "]";
return repoName + "\t" + message;
}
});

Expand All @@ -87,10 +88,11 @@ String msgForRepo(String message) {
throw new StudyImporterException(getResultMsg(repoName, warnings, errors) + ", please check your log.");
}
} finally {
infos.forEach(LOG::info);
warnings.forEach(LOG::warn);
errors.forEach(LOG::error);
System.out.println("\n" + getResultMsg(repoName, warnings, errors));
infos.forEach(System.out::println);
warnings.forEach(System.out::println);
errors.forEach(System.out::println);
System.out.println(repoName + "\t" + errors.size() + " error(s)");
System.out.println(repoName + "\t" + warnings.size() + " warning(s)");
}
}

Expand All @@ -111,10 +113,10 @@ private static class NodeFactoryLogging extends NodeFactoryNull {
@Override
public void interactsWith(Specimen target, InteractType type, Location centroid) {
if (counter.get() > 0 && counter.get() % 1000 == 0) {
System.out.println();
System.err.println();
}
if (counter.get() % 10 == 0) {
System.out.print(".");
System.err.print(".");
}
counter.getAndIncrement();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public static void run(String[] args) throws Throwable {
CmdLine.run(jc.getCommands().get(jc.getParsedCommand()));
} catch (Throwable ex) {
LOG.error("unexpected exception", ex);
StringBuilder out = new StringBuilder();
jc.usage(out);
System.err.append(out.toString());
throw ex;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.err
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.stdout.layout.ConversionPattern=%m%n

0 comments on commit 28f8d20

Please sign in to comment.