Skip to content

Commit

Permalink
[Java] Handle if logging is not available on the Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Jun 11, 2020
1 parent 03bce95 commit 5ccaebd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,14 @@ public void configureLogging() {
}

private OutputStream getOutputStream() throws FileNotFoundException {
String fileName = config.get(LOGGING_SECTION, "log-file").get();
FileOutputStream fileOut = null;
String fileName = config.get(LOGGING_SECTION, "log-file").orElse("null");
OutputStream fileOut = null;
if (fileName != "null") {
fileOut = new FileOutputStream(fileName);
}
if (fileOut == null) {
fileOut = System.out;
}
return fileOut;
}
}

0 comments on commit 5ccaebd

Please sign in to comment.