Add <reset_correct> tag to logging system
Some checks failed
build-and-test / build (push) Failing after 1m6s
build-and-test / test (push) Failing after 1m11s
build-and-test / generate-javadoc (push) Failing after 1m14s

This commit is contained in:
JeremyStar™ 2024-12-05 15:37:37 +01:00
parent 0c26660f27
commit 499d704695
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -132,7 +132,7 @@ public final class Processor {
}
output.append("] ");
}
message(output, message);
message(output, level, message);
format(output, "reset");
// Print
@ -346,12 +346,14 @@ public final class Processor {
* Adds the {@code message} component.
*
* @param builder {@link StringBuilder} instance to append to
* @param level level of the log call
* @param message message
* @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(
message.replace(
message
.replace(
"\n",
"\n" + " ".repeat(
new EmptyShortcodeParser(builder.toString(), true)
@ -363,6 +365,13 @@ public final class Processor {
if (Logger.isSanitizeMessages())
finalizedMessage = sanitizeFormat(finalizedMessage);
else {
StringBuilder reset_correct = new StringBuilder();
format(reset_correct, level);
finalizedMessage = finalizedMessage
.replace("<reset_correct>", reset_correct);
}
builder.append(finalizedMessage);
}