mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Unify plugin remapping debug flags
This commit is contained in:
parent
4f09300744
commit
43b52c8d61
1 changed files with 2 additions and 4 deletions
|
@ -239,13 +239,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+/**
|
||||
+ * {@link PrintWriter}-backed logger implementation for use with {@link net.neoforged.art.api.Renamer} which
|
||||
+ * only opens the backing writer and logs messages when the {@link #DEBUG} system property
|
||||
+ * only opens the backing writer and logs messages when the {@link PluginRemapper#DEBUG_LOGGING} system property
|
||||
+ * is set to true.
|
||||
+ */
|
||||
+@DefaultQualifier(NonNull.class)
|
||||
+final class DebugLogger implements Consumer<String>, AutoCloseable {
|
||||
+ private static final boolean DEBUG = Boolean.getBoolean("paper.remap-debug");
|
||||
+
|
||||
+ private final @Nullable PrintWriter writer;
|
||||
+
|
||||
+ DebugLogger(final Path logFile) {
|
||||
|
@ -282,7 +280,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+ private static @Nullable PrintWriter createWriter(final Path logFile) throws IOException {
|
||||
+ if (!DEBUG) {
|
||||
+ if (!PluginRemapper.DEBUG_LOGGING) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ if (!Files.exists(logFile.getParent())) {
|
||||
|
|
Loading…
Reference in a new issue