Skip to content

Commit dbce274

Browse files
committed
Avoid closing System#out stream
Although you can, not all JVMs appreciate it
1 parent 4af4bbf commit dbce274

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

common/src/main/java/com/fox2code/foxloader/launcher/LoggerHelper.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,14 @@ public synchronized void publish(LogRecord record) {
209209

210210
private static class SystemOutConsoleHandler extends ConsoleHandler {
211211
SystemOutConsoleHandler() {
212-
setOutputStream(System.out);
213212
setFormatter(new FoxLoaderConsoleLogFormatter());
214213
setLevel(Level.ALL);
215214
}
215+
216+
@Override
217+
protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
218+
super.setOutputStream(System.out);
219+
}
216220
}
217221

218222
private static class CantInstallLoggerHelperException extends Exception {

0 commit comments

Comments
 (0)