1
0
mirror of https://github.com/suk-ws/messiva.git synced 2024-11-25 22:57:36 +08:00

补充意外缺少的 LogLevel.DEBUG

This commit is contained in:
A.C.Sukazyo Eyre 2021-12-13 22:57:49 +08:00
parent 64328904d7
commit 31ccf14941
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
4 changed files with 25 additions and 2 deletions

View File

@ -1,6 +1,6 @@
## Messiva ## Messiva
PROJECT_VERSION = 0.1.0.0 PROJECT_VERSION = 0.1.0.1
## dependencies ## dependencies

View File

@ -1,6 +1,7 @@
package cc.sukazyo.messiva; package cc.sukazyo.messiva;
import cc.sukazyo.messiva.appender.IAppender; import cc.sukazyo.messiva.appender.IAppender;
import cc.sukazyo.messiva.log.ILogLevelImpl;
import cc.sukazyo.messiva.log.Log; import cc.sukazyo.messiva.log.Log;
import cc.sukazyo.messiva.log.LogLevel; import cc.sukazyo.messiva.log.LogLevel;
import cc.sukazyo.messiva.log.Message; import cc.sukazyo.messiva.log.Message;
@ -9,7 +10,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
public class Logger { public class Logger implements ILogLevelImpl {
public final List<IAppender> appends = new ArrayList<>(); public final List<IAppender> appends = new ArrayList<>();
@ -23,6 +24,10 @@ public class Logger {
pushToAllAppender(new Log(1, new Message(message), LogLevel.TRACE)); pushToAllAppender(new Log(1, new Message(message), LogLevel.TRACE));
} }
public void debug (String message) {
pushToAllAppender(new Log(1, new Message(message), LogLevel.DEBUG));
}
public void info (String message) { public void info (String message) {
pushToAllAppender(new Log(1, new Message(message), LogLevel.INFO)); pushToAllAppender(new Log(1, new Message(message), LogLevel.INFO));
} }

View File

@ -0,0 +1,17 @@
package cc.sukazyo.messiva.log;
public interface ILogLevelImpl {
void trace (String message);
void debug (String message);
void info (String message);
void warn (String message);
void error (String message);
void fatal (String message);
}

View File

@ -3,6 +3,7 @@ package cc.sukazyo.messiva.log;
public enum LogLevel { public enum LogLevel {
TRACE(-1f, "TRAC"), TRACE(-1f, "TRAC"),
DEBUG(-0.1f, "DBUG"),
INFO(0f, "INFO"), INFO(0f, "INFO"),
WARN(0.5f, "WARN"), WARN(0.5f, "WARN"),
ERROR(1f, "ERRO"), ERROR(1f, "ERRO"),