Mercurial Hosting > luan
diff src/goodjava/logging/Log4jFactory.java @ 1448:6fc083e1d08c
start logger
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 23 Feb 2020 18:14:32 -0700 |
parents | 27efb1fcbcb5 |
children |
line wrap: on
line diff
--- a/src/goodjava/logging/Log4jFactory.java Tue Feb 18 14:54:35 2020 -0700 +++ b/src/goodjava/logging/Log4jFactory.java Sun Feb 23 18:14:32 2020 -0700 @@ -1,7 +1,7 @@ package goodjava.logging; -public final class Log4jFactory extends LoggerFactory { +public final class Log4jFactory implements ILoggerFactory { private static final class Log4jLogger implements Logger { final org.apache.log4j.Logger log4j; @@ -33,6 +33,10 @@ log4j.info(msg,t); } + @Override public boolean isInfoEnabled() { + return log4j.isInfoEnabled(); + } + @Override public void debug(String msg) { log4j.debug(msg); } @@ -40,13 +44,13 @@ @Override public void debug(String msg,Throwable t) { log4j.debug(msg,t); } + + @Override public boolean isDebugEnabled() { + return log4j.isDebugEnabled(); + } } - @Override protected Logger getLoggerImpl(Class cls) { - return new Log4jLogger(org.apache.log4j.Logger.getLogger(cls)); - } - - @Override protected Logger getLoggerImpl(String name) { + @Override public Logger getLogger(String name) { return new Log4jLogger(org.apache.log4j.Logger.getLogger(name)); } }