Skip to content

Commit

Permalink
Avoid closing System#out stream
Browse files Browse the repository at this point in the history
Although you can, not all JVMs appreciate it
  • Loading branch information
Chocohead committed Mar 31, 2024
1 parent 4af4bbf commit dbce274
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,14 @@ public synchronized void publish(LogRecord record) {

private static class SystemOutConsoleHandler extends ConsoleHandler {
SystemOutConsoleHandler() {
setOutputStream(System.out);
setFormatter(new FoxLoaderConsoleLogFormatter());
setLevel(Level.ALL);
}

@Override
protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
super.setOutputStream(System.out);
}
}

private static class CantInstallLoggerHelperException extends Exception {
Expand Down

0 comments on commit dbce274

Please sign in to comment.