diff --git a/src/main/java/com/sunyard/sge/log/SydLogger.java b/src/main/java/com/sunyard/sge/log/SydLogger.java index 41924e7..19db932 100644 --- a/src/main/java/com/sunyard/sge/log/SydLogger.java +++ b/src/main/java/com/sunyard/sge/log/SydLogger.java @@ -5,17 +5,32 @@ import java.util.concurrent.ConcurrentLinkedQueue; public class SydLogger { private ConcurrentLinkedQueue queue; + SydLogger(ConcurrentLinkedQueue 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 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){ - this.queue.add( new LogInfo(1, msg, params) ); + + public void error(String msg, Object... params) { + if (SydLogFactory.iLogLevel >= 1) { + this.queue.add(new LogInfo(1, msg, params)); + } else { + return; + } } }