Add <reset_correct> tag to logging system
This commit is contained in:
parent
0c26660f27
commit
499d704695
1 changed files with 18 additions and 9 deletions
|
@ -132,7 +132,7 @@ public final class Processor {
|
||||||
}
|
}
|
||||||
output.append("] ");
|
output.append("] ");
|
||||||
}
|
}
|
||||||
message(output, message);
|
message(output, level, message);
|
||||||
format(output, "reset");
|
format(output, "reset");
|
||||||
|
|
||||||
// Print
|
// Print
|
||||||
|
@ -346,12 +346,14 @@ public final class Processor {
|
||||||
* Adds the {@code message} component.
|
* Adds the {@code message} component.
|
||||||
*
|
*
|
||||||
* @param builder {@link StringBuilder} instance to append to
|
* @param builder {@link StringBuilder} instance to append to
|
||||||
|
* @param level level of the log call
|
||||||
* @param message message
|
* @param message message
|
||||||
* @since v1-alpha8
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
private static void message(@NotNull StringBuilder builder, @NotNull String message) {
|
private static void message(@NotNull StringBuilder builder, @NotNull LogLevel level, @NotNull String message) {
|
||||||
String finalizedMessage = handlePlaceholders(
|
String finalizedMessage = handlePlaceholders(
|
||||||
message.replace(
|
message
|
||||||
|
.replace(
|
||||||
"\n",
|
"\n",
|
||||||
"\n" + " ".repeat(
|
"\n" + " ".repeat(
|
||||||
new EmptyShortcodeParser(builder.toString(), true)
|
new EmptyShortcodeParser(builder.toString(), true)
|
||||||
|
@ -363,6 +365,13 @@ public final class Processor {
|
||||||
|
|
||||||
if (Logger.isSanitizeMessages())
|
if (Logger.isSanitizeMessages())
|
||||||
finalizedMessage = sanitizeFormat(finalizedMessage);
|
finalizedMessage = sanitizeFormat(finalizedMessage);
|
||||||
|
else {
|
||||||
|
StringBuilder reset_correct = new StringBuilder();
|
||||||
|
format(reset_correct, level);
|
||||||
|
|
||||||
|
finalizedMessage = finalizedMessage
|
||||||
|
.replace("<reset_correct>", reset_correct);
|
||||||
|
}
|
||||||
|
|
||||||
builder.append(finalizedMessage);
|
builder.append(finalizedMessage);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue