Add <reset_correct> tag to logging system

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,23 +346,32 @@ 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(
"\n",
"\n" + " ".repeat(
new EmptyShortcodeParser(builder.toString(), true)
.getClean()
.length()
)
message
.replace(
"\n",
"\n" + " ".repeat(
new EmptyShortcodeParser(builder.toString(), true)
.getClean()
.length()
)
)
);
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);
}