diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-01-27 21:48:55 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-01-27 22:03:17 +0800 |
| commit | 24772ad23f2b0e2df256c409b523b64bfc474c3c (patch) | |
| tree | 38fc596ad7cc42eabecce9a530a8be9fae2c2501 /runtime/src/main | |
| parent | d3ee650be4775ee8bb87a7b5cc04301c1c6885a0 (diff) | |
| download | RoughlyEnoughItems-24772ad23f2b0e2df256c409b523b64bfc474c3c.tar.gz RoughlyEnoughItems-24772ad23f2b0e2df256c409b523b64bfc474c3c.tar.bz2 RoughlyEnoughItems-24772ad23f2b0e2df256c409b523b64bfc474c3c.zip | |
Fix #719
Diffstat (limited to 'runtime/src/main')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/common/logging/FileLogger.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/logging/FileLogger.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/logging/FileLogger.java index abd192ba6..d773113d7 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/common/logging/FileLogger.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/logging/FileLogger.java @@ -23,6 +23,7 @@ package me.shedaniel.rei.impl.common.logging; +import org.apache.commons.io.output.NullOutputStream; import org.apache.logging.log4j.Level; import java.io.*; @@ -37,13 +38,17 @@ public class FileLogger implements Logger { private final Writer writer; public FileLogger(Path file) { + Writer w; try { if (file.getParent() != null) Files.createDirectories(file.getParent()); file.toFile().createNewFile(); - this.writer = new OutputStreamWriter(new FileOutputStream(file.toFile()), StandardCharsets.UTF_8); + w = new OutputStreamWriter(new FileOutputStream(file.toFile()), StandardCharsets.UTF_8); } catch (IOException exception) { - throw new UncheckedIOException(exception); + exception.printStackTrace(); + w = new OutputStreamWriter(new NullOutputStream()); } + + this.writer = w; } @Override |
