forked from StarOpenSource/Engine
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("] ");
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue