修改日志

This commit is contained in:
junj2.liang 2022-09-02 17:02:56 +08:00
parent 36b48af67d
commit 048ecdeb3b

View File

@ -5,17 +5,32 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class SydLogger {
private ConcurrentLinkedQueue<LogInfo> queue;
SydLogger(ConcurrentLinkedQueue<LogInfo> queue) {
this.queue = queue;
}
public void debug(String msg, Object... params){
this.queue.add( new LogInfo(3, msg, params) );
public void debug(String msg, Object... params) {
if (SydLogFactory.iLogLevel == 3) {
this.queue.add(new LogInfo(3, msg, params));
} else {
return;
}
public void info(String msg, Object... params){
this.queue.add( new LogInfo(2, msg, params) );
}
public void error(String msg, Object... params){
this.queue.add( new LogInfo(1, msg, params) );
public void info(String msg, Object... params) {
if (SydLogFactory.iLogLevel >= 2) {
this.queue.add(new LogInfo(2, msg, params));
} else {
return;
}
}
public void error(String msg, Object... params) {
if (SydLogFactory.iLogLevel >= 1) {
this.queue.add(new LogInfo(1, msg, params));
} else {
return;
}
}
}