(misc) Add color to the console

This commit is contained in:
KingRainbow44
2023-11-26 00:57:34 -05:00
parent 43ca56f8e6
commit 54119bc5b0
2 changed files with 5 additions and 6 deletions

View File

@@ -8,22 +8,22 @@ import emu.lunarcore.LunarCore;
public class LunarConsoleAppender extends AppenderBase<ILoggingEvent> {
protected PatternLayout layout;
@Override
public void start() {
this.layout = new PatternLayout();
this.layout.setContext(context);
this.layout.setPattern("[%d{HH:mm:ss}] [%level] %msg%n");
this.layout.setPattern("[%cyan(%d{HH:mm:ss})] [%highlight(%level)] %msg%n");
this.layout.start();
super.start();
}
@Override
public void stop() {
super.stop();
this.layout.stop();
}
@Override
protected void append(ILoggingEvent event) {
if (LunarCore.isUsingDumbTerminal()) {

View File

@@ -1,7 +1,6 @@
<Configuration>
<appender name="CONSOLE" class="emu.lunarcore.util.LunarConsoleAppender">
</appender>
<appender name="CONSOLE" class="emu.lunarcore.util.LunarConsoleAppender" />
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/latest.log</file>