Skip to content

Commit 4e7a01c

Browse files
committed
Overrides handlesThrowable
1 parent 98eca68 commit 4e7a01c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

bukkit/src/main/java/io/github/rothes/protocolstringreplacer/console/PsrLogEventPatternConverter.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,26 @@ public void format(LogEvent event, StringBuilder toAppendTo) {
7575
}
7676
}
7777

78+
@Override
79+
public boolean handlesThrowable() {
80+
for (final PatternFormatter formatter : formatters) {
81+
if (formatter.handlesThrowable()) {
82+
return true;
83+
}
84+
}
85+
return false;
86+
}
87+
7888
@SuppressWarnings("unused")
7989
public static PsrLogEventPatternConverter newInstance(Configuration config, String[] options) {
8090
if (options.length < 1 || options.length > 2) {
81-
LOGGER.error("Incorrect number of options on minecraftFormatting. Expected at least 1, max 2 received " + options.length);
91+
LOGGER.error("Incorrect number of options. Expected at least 1, max 2 received " + options.length);
8292
return null;
8393
}
84-
return new PsrLogEventPatternConverter(PatternLayout.createPatternParser(config).parse(ConsoleReplaceManager.getPatterns().get(Short.parseShort(options[0]))),
85-
options.length >= 2 && "removeAnsi".equals(options[1]));
94+
return new PsrLogEventPatternConverter(
95+
PatternLayout.createPatternParser(config).parse(ConsoleReplaceManager.getPatterns().get(Short.parseShort(options[0]))),
96+
options.length == 2 && "removeAnsi".equals(options[1])
97+
);
8698
}
8799

88100
}

0 commit comments

Comments
 (0)