* Moved all factory methods in InternalLogger to InternalLoggerFactory

* Made InternalLogger an interface
This commit is contained in:
Trustin Lee 2008-08-09 15:05:53 +00:00
parent d5d92ae04d
commit e50a736c29
23 changed files with 56 additions and 100 deletions

View File

@ -39,6 +39,7 @@ import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.SimpleChannelHandler; import org.jboss.netty.channel.SimpleChannelHandler;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
/** /**
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)
@ -50,7 +51,7 @@ import org.jboss.netty.logging.InternalLogger;
*/ */
public class Bootstrap { public class Bootstrap {
private static InternalLogger logger = InternalLogger.getLogger(Bootstrap.class); private static InternalLogger logger = InternalLoggerFactory.getInstance(Bootstrap.class);
private volatile ChannelFactory factory; private volatile ChannelFactory factory;
private volatile ChannelPipeline pipeline = pipeline(); private volatile ChannelPipeline pipeline = pipeline();

View File

@ -25,11 +25,12 @@ package org.jboss.netty.channel;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
public abstract class CompleteChannelFuture implements ChannelFuture { public abstract class CompleteChannelFuture implements ChannelFuture {
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLogger.getLogger(CompleteChannelFuture.class); InternalLoggerFactory.getInstance(CompleteChannelFuture.class);
private final Channel channel; private final Channel channel;

View File

@ -27,12 +27,13 @@ import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
public class DefaultChannelFuture implements ChannelFuture { public class DefaultChannelFuture implements ChannelFuture {
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLogger.getLogger(DefaultChannelFuture.class); InternalLoggerFactory.getInstance(DefaultChannelFuture.class);
private static final int DEAD_LOCK_CHECK_INTERVAL = 5000; private static final int DEAD_LOCK_CHECK_INTERVAL = 5000;
private static final Throwable CANCELLED = new Throwable(); private static final Throwable CANCELLED = new Throwable();

View File

@ -31,11 +31,12 @@ import java.util.Map;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
public class DefaultChannelPipeline implements ChannelPipeline { public class DefaultChannelPipeline implements ChannelPipeline {
static final InternalLogger logger = InternalLogger.getLogger(DefaultChannelPipeline.class); static final InternalLogger logger = InternalLoggerFactory.getInstance(DefaultChannelPipeline.class);
private final ChannelSink discardingSink = new ChannelSink() { private final ChannelSink discardingSink = new ChannelSink() {
public void eventSunk(ChannelPipeline pipeline, ChannelEvent e) { public void eventSunk(ChannelPipeline pipeline, ChannelEvent e) {

View File

@ -23,6 +23,7 @@
package org.jboss.netty.channel; package org.jboss.netty.channel;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
/** /**
@ -35,7 +36,7 @@ import org.jboss.netty.logging.InternalLogger;
public class SimpleChannelHandler implements ChannelUpstreamHandler { public class SimpleChannelHandler implements ChannelUpstreamHandler {
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLogger.getLogger(SimpleChannelHandler.class.getName()); InternalLoggerFactory.getInstance(SimpleChannelHandler.class.getName());
public void handleUpstream( public void handleUpstream(
ChannelHandlerContext ctx, ChannelEvent e) throws Exception { ChannelHandlerContext ctx, ChannelEvent e) throws Exception {

View File

@ -33,11 +33,12 @@ import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink; import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
class NioClientSocketChannel extends NioSocketChannel { class NioClientSocketChannel extends NioSocketChannel {
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLogger.getLogger(NioClientSocketChannel.class); InternalLoggerFactory.getInstance(NioClientSocketChannel.class);
private static SocketChannel newSocket() { private static SocketChannel newSocket() {
SocketChannel socket; SocketChannel socket;

View File

@ -45,12 +45,13 @@ import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.NamePreservingRunnable; import org.jboss.netty.util.NamePreservingRunnable;
class NioClientSocketPipelineSink extends AbstractChannelSink { class NioClientSocketPipelineSink extends AbstractChannelSink {
static final InternalLogger logger = static final InternalLogger logger =
InternalLogger.getLogger(NioClientSocketPipelineSink.class); InternalLoggerFactory.getInstance(NioClientSocketPipelineSink.class);
private static final AtomicInteger nextId = new AtomicInteger(); private static final AtomicInteger nextId = new AtomicInteger();
final int id = nextId.incrementAndGet(); final int id = nextId.incrementAndGet();

View File

@ -37,12 +37,13 @@ import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig; import org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig;
import org.jboss.netty.channel.socket.ServerSocketChannelConfig; import org.jboss.netty.channel.socket.ServerSocketChannelConfig;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
class NioServerSocketChannel extends AbstractServerChannel class NioServerSocketChannel extends AbstractServerChannel
implements org.jboss.netty.channel.socket.ServerSocketChannel { implements org.jboss.netty.channel.socket.ServerSocketChannel {
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLogger.getLogger(NioServerSocketChannel.class); InternalLoggerFactory.getInstance(NioServerSocketChannel.class);
final ServerSocketChannel socket; final ServerSocketChannel socket;
private final ServerSocketChannelConfig config; private final ServerSocketChannelConfig config;

View File

@ -41,12 +41,13 @@ import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.NamePreservingRunnable; import org.jboss.netty.util.NamePreservingRunnable;
class NioServerSocketPipelineSink extends AbstractChannelSink { class NioServerSocketPipelineSink extends AbstractChannelSink {
static final InternalLogger logger = static final InternalLogger logger =
InternalLogger.getLogger(NioServerSocketPipelineSink.class); InternalLoggerFactory.getInstance(NioServerSocketPipelineSink.class);
private static final AtomicInteger nextId = new AtomicInteger(); private static final AtomicInteger nextId = new AtomicInteger();
private final int id = nextId.incrementAndGet(); private final int id = nextId.incrementAndGet();

View File

@ -41,11 +41,12 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelException; import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.NamePreservingRunnable; import org.jboss.netty.util.NamePreservingRunnable;
class NioWorker implements Runnable { class NioWorker implements Runnable {
private static final InternalLogger logger = InternalLogger.getLogger(NioWorker.class); private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioWorker.class);
private final int bossId; private final int bossId;
private final int id; private final int id;

View File

@ -38,12 +38,13 @@ import org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig;
import org.jboss.netty.channel.socket.ServerSocketChannel; import org.jboss.netty.channel.socket.ServerSocketChannel;
import org.jboss.netty.channel.socket.ServerSocketChannelConfig; import org.jboss.netty.channel.socket.ServerSocketChannelConfig;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
class OioServerSocketChannel extends AbstractServerChannel class OioServerSocketChannel extends AbstractServerChannel
implements ServerSocketChannel { implements ServerSocketChannel {
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLogger.getLogger(OioServerSocketChannel.class); InternalLoggerFactory.getInstance(OioServerSocketChannel.class);
final ServerSocket socket; final ServerSocket socket;
private final ServerSocketChannelConfig config; private final ServerSocketChannelConfig config;

View File

@ -39,12 +39,13 @@ import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.NamePreservingRunnable; import org.jboss.netty.util.NamePreservingRunnable;
class OioServerSocketPipelineSink extends AbstractChannelSink { class OioServerSocketPipelineSink extends AbstractChannelSink {
static final InternalLogger logger = static final InternalLogger logger =
InternalLogger.getLogger(OioServerSocketPipelineSink.class); InternalLoggerFactory.getInstance(OioServerSocketPipelineSink.class);
final Executor workerExecutor; final Executor workerExecutor;

View File

@ -23,6 +23,7 @@
package org.jboss.netty.example.factorial; package org.jboss.netty.example.factorial;
import static org.jboss.netty.channel.Channels.*; import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.ChannelPipelineFactory;

View File

@ -23,6 +23,7 @@
package org.jboss.netty.example.factorial; package org.jboss.netty.example.factorial;
import static org.jboss.netty.channel.Channels.*; import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.ChannelPipelineFactory;

View File

@ -23,6 +23,7 @@
package org.jboss.netty.example.telnet; package org.jboss.netty.example.telnet;
import static org.jboss.netty.channel.Channels.*; import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.channel.ChannelHandler; import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.ChannelPipelineFactory;

View File

@ -33,66 +33,54 @@ package org.jboss.netty.logging;
public class CommonsLoggerFactory extends InternalLoggerFactory { public class CommonsLoggerFactory extends InternalLoggerFactory {
@Override @Override
public InternalLogger getInstance(String name) { public InternalLogger newInstance(String name) {
final org.apache.commons.logging.Log logger = final org.apache.commons.logging.Log logger =
org.apache.commons.logging.LogFactory.getLog(name); org.apache.commons.logging.LogFactory.getLog(name);
return new InternalLogger() { return new InternalLogger() {
@Override
public void debug(String msg) { public void debug(String msg) {
logger.debug(msg); logger.debug(msg);
} }
@Override
public void debug(String msg, Throwable cause) { public void debug(String msg, Throwable cause) {
logger.debug(msg, cause); logger.debug(msg, cause);
} }
@Override
public void error(String msg) { public void error(String msg) {
logger.error(msg); logger.error(msg);
} }
@Override
public void error(String msg, Throwable cause) { public void error(String msg, Throwable cause) {
logger.error(msg, cause); logger.error(msg, cause);
} }
@Override
public void info(String msg) { public void info(String msg) {
logger.info(msg); logger.info(msg);
} }
@Override
public void info(String msg, Throwable cause) { public void info(String msg, Throwable cause) {
logger.info(msg, cause); logger.info(msg, cause);
} }
@Override
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return logger.isDebugEnabled(); return logger.isDebugEnabled();
} }
@Override
public boolean isErrorEnabled() { public boolean isErrorEnabled() {
return logger.isErrorEnabled(); return logger.isErrorEnabled();
} }
@Override
public boolean isInfoEnabled() { public boolean isInfoEnabled() {
return logger.isInfoEnabled(); return logger.isInfoEnabled();
} }
@Override
public boolean isWarnEnabled() { public boolean isWarnEnabled() {
return logger.isWarnEnabled(); return logger.isWarnEnabled();
} }
@Override
public void warn(String msg) { public void warn(String msg) {
logger.warn(msg); logger.warn(msg);
} }
@Override
public void warn(String msg, Throwable cause) { public void warn(String msg, Throwable cause) {
logger.warn(msg, cause); logger.warn(msg, cause);
} }

View File

@ -29,26 +29,18 @@ package org.jboss.netty.logging;
* @version $Rev$, $Date$ * @version $Rev$, $Date$
* *
*/ */
public abstract class InternalLogger { public interface InternalLogger {
public static InternalLogger getLogger(Class<?> clazz) { boolean isDebugEnabled();
return getLogger(clazz.getName()); boolean isInfoEnabled();
} boolean isWarnEnabled();
boolean isErrorEnabled();
public static InternalLogger getLogger(String name) { void debug(String msg);
return InternalLoggerFactory.getDefault().getInstance(name); void debug(String msg, Throwable cause);
} void info(String msg);
void info(String msg, Throwable cause);
public abstract boolean isDebugEnabled(); void warn(String msg);
public abstract boolean isInfoEnabled(); void warn(String msg, Throwable cause);
public abstract boolean isWarnEnabled(); void error(String msg);
public abstract boolean isErrorEnabled(); void error(String msg, Throwable cause);
public abstract void debug(String msg);
public abstract void debug(String msg, Throwable cause);
public abstract void info(String msg);
public abstract void info(String msg, Throwable cause);
public abstract void warn(String msg);
public abstract void warn(String msg, Throwable cause);
public abstract void error(String msg);
public abstract void error(String msg, Throwable cause);
} }

View File

@ -43,5 +43,13 @@ public abstract class InternalLoggerFactory {
InternalLoggerFactory.defaultInstance = defaultInstance; InternalLoggerFactory.defaultInstance = defaultInstance;
} }
public abstract InternalLogger getInstance(String name); public static InternalLogger getInstance(Class<?> clazz) {
return getInstance(clazz);
}
public static InternalLogger getInstance(String name) {
return getDefault().newInstance(name);
}
public abstract InternalLogger newInstance(String name);
} }

View File

@ -33,68 +33,56 @@ package org.jboss.netty.logging;
public class JBossLoggerFactory extends InternalLoggerFactory { public class JBossLoggerFactory extends InternalLoggerFactory {
@Override @Override
public InternalLogger getInstance(String name) { public InternalLogger newInstance(String name) {
final org.jboss.logging.Logger logger = final org.jboss.logging.Logger logger =
org.jboss.logging.Logger.getLogger(name); org.jboss.logging.Logger.getLogger(name);
return new InternalLogger() { return new InternalLogger() {
@Override
public void debug(String msg) { public void debug(String msg) {
logger.debug(msg); logger.debug(msg);
} }
@Override
public void debug(String msg, Throwable cause) { public void debug(String msg, Throwable cause) {
logger.debug(msg, cause); logger.debug(msg, cause);
} }
@Override
public void error(String msg) { public void error(String msg) {
logger.error(msg); logger.error(msg);
} }
@Override
public void error(String msg, Throwable cause) { public void error(String msg, Throwable cause) {
logger.error(msg, cause); logger.error(msg, cause);
} }
@Override
public void info(String msg) { public void info(String msg) {
logger.info(msg); logger.info(msg);
} }
@Override
public void info(String msg, Throwable cause) { public void info(String msg, Throwable cause) {
logger.info(msg, cause); logger.info(msg, cause);
} }
@Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return logger.isDebugEnabled(); return logger.isDebugEnabled();
} }
@Override
public boolean isErrorEnabled() { public boolean isErrorEnabled() {
return true; return true;
} }
@Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public boolean isInfoEnabled() { public boolean isInfoEnabled() {
return logger.isInfoEnabled(); return logger.isInfoEnabled();
} }
@Override
public boolean isWarnEnabled() { public boolean isWarnEnabled() {
return true; return true;
} }
@Override
public void warn(String msg) { public void warn(String msg) {
logger.warn(msg); logger.warn(msg);
} }
@Override
public void warn(String msg, Throwable cause) { public void warn(String msg, Throwable cause) {
logger.warn(msg, cause); logger.warn(msg, cause);
} }

View File

@ -34,66 +34,54 @@ import java.util.logging.Level;
public class JdkLoggerFactory extends InternalLoggerFactory { public class JdkLoggerFactory extends InternalLoggerFactory {
@Override @Override
public InternalLogger getInstance(String name) { public InternalLogger newInstance(String name) {
final java.util.logging.Logger logger = final java.util.logging.Logger logger =
java.util.logging.Logger.getLogger(name); java.util.logging.Logger.getLogger(name);
return new InternalLogger() { return new InternalLogger() {
@Override
public void debug(String msg) { public void debug(String msg) {
logger.log(Level.FINE, msg); logger.log(Level.FINE, msg);
} }
@Override
public void debug(String msg, Throwable cause) { public void debug(String msg, Throwable cause) {
logger.log(Level.FINE, msg, cause); logger.log(Level.FINE, msg, cause);
} }
@Override
public void error(String msg) { public void error(String msg) {
logger.log(Level.SEVERE, msg); logger.log(Level.SEVERE, msg);
} }
@Override
public void error(String msg, Throwable cause) { public void error(String msg, Throwable cause) {
logger.log(Level.SEVERE, msg, cause); logger.log(Level.SEVERE, msg, cause);
} }
@Override
public void info(String msg) { public void info(String msg) {
logger.log(Level.INFO, msg); logger.log(Level.INFO, msg);
} }
@Override
public void info(String msg, Throwable cause) { public void info(String msg, Throwable cause) {
logger.log(Level.INFO, msg, cause); logger.log(Level.INFO, msg, cause);
} }
@Override
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return logger.isLoggable(Level.FINE); return logger.isLoggable(Level.FINE);
} }
@Override
public boolean isErrorEnabled() { public boolean isErrorEnabled() {
return logger.isLoggable(Level.SEVERE); return logger.isLoggable(Level.SEVERE);
} }
@Override
public boolean isInfoEnabled() { public boolean isInfoEnabled() {
return logger.isLoggable(Level.INFO); return logger.isLoggable(Level.INFO);
} }
@Override
public boolean isWarnEnabled() { public boolean isWarnEnabled() {
return logger.isLoggable(Level.WARNING); return logger.isLoggable(Level.WARNING);
} }
@Override
public void warn(String msg) { public void warn(String msg) {
logger.log(Level.WARNING, msg); logger.log(Level.WARNING, msg);
} }
@Override
public void warn(String msg, Throwable cause) { public void warn(String msg, Throwable cause) {
logger.log(Level.WARNING, msg, cause); logger.log(Level.WARNING, msg, cause);
} }

View File

@ -33,66 +33,54 @@ package org.jboss.netty.logging;
public class Log4JLoggerFactory extends InternalLoggerFactory { public class Log4JLoggerFactory extends InternalLoggerFactory {
@Override @Override
public InternalLogger getInstance(String name) { public InternalLogger newInstance(String name) {
final org.apache.log4j.Logger logger = final org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getLogger(name); org.apache.log4j.Logger.getLogger(name);
return new InternalLogger() { return new InternalLogger() {
@Override
public void debug(String msg) { public void debug(String msg) {
logger.debug(msg); logger.debug(msg);
} }
@Override
public void debug(String msg, Throwable cause) { public void debug(String msg, Throwable cause) {
logger.debug(msg, cause); logger.debug(msg, cause);
} }
@Override
public void error(String msg) { public void error(String msg) {
logger.error(msg); logger.error(msg);
} }
@Override
public void error(String msg, Throwable cause) { public void error(String msg, Throwable cause) {
logger.error(msg, cause); logger.error(msg, cause);
} }
@Override
public void info(String msg) { public void info(String msg) {
logger.info(msg); logger.info(msg);
} }
@Override
public void info(String msg, Throwable cause) { public void info(String msg, Throwable cause) {
logger.info(msg, cause); logger.info(msg, cause);
} }
@Override
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return logger.isDebugEnabled(); return logger.isDebugEnabled();
} }
@Override
public boolean isErrorEnabled() { public boolean isErrorEnabled() {
return true; return true;
} }
@Override
public boolean isInfoEnabled() { public boolean isInfoEnabled() {
return logger.isInfoEnabled(); return logger.isInfoEnabled();
} }
@Override
public boolean isWarnEnabled() { public boolean isWarnEnabled() {
return true; return true;
} }
@Override
public void warn(String msg) { public void warn(String msg) {
logger.warn(msg); logger.warn(msg);
} }
@Override
public void warn(String msg, Throwable cause) { public void warn(String msg, Throwable cause) {
logger.warn(msg, cause); logger.warn(msg, cause);
} }

View File

@ -33,66 +33,54 @@ package org.jboss.netty.logging;
public class Slf4JLoggerFactory extends InternalLoggerFactory { public class Slf4JLoggerFactory extends InternalLoggerFactory {
@Override @Override
public InternalLogger getInstance(String name) { public InternalLogger newInstance(String name) {
final org.slf4j.Logger logger = final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(name); org.slf4j.LoggerFactory.getLogger(name);
return new InternalLogger() { return new InternalLogger() {
@Override
public void debug(String msg) { public void debug(String msg) {
logger.debug(msg); logger.debug(msg);
} }
@Override
public void debug(String msg, Throwable cause) { public void debug(String msg, Throwable cause) {
logger.debug(msg, cause); logger.debug(msg, cause);
} }
@Override
public void error(String msg) { public void error(String msg) {
logger.error(msg); logger.error(msg);
} }
@Override
public void error(String msg, Throwable cause) { public void error(String msg, Throwable cause) {
logger.error(msg, cause); logger.error(msg, cause);
} }
@Override
public void info(String msg) { public void info(String msg) {
logger.info(msg); logger.info(msg);
} }
@Override
public void info(String msg, Throwable cause) { public void info(String msg, Throwable cause) {
logger.info(msg, cause); logger.info(msg, cause);
} }
@Override
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return logger.isDebugEnabled(); return logger.isDebugEnabled();
} }
@Override
public boolean isErrorEnabled() { public boolean isErrorEnabled() {
return logger.isErrorEnabled(); return logger.isErrorEnabled();
} }
@Override
public boolean isInfoEnabled() { public boolean isInfoEnabled() {
return logger.isInfoEnabled(); return logger.isInfoEnabled();
} }
@Override
public boolean isWarnEnabled() { public boolean isWarnEnabled() {
return logger.isWarnEnabled(); return logger.isWarnEnabled();
} }
@Override
public void warn(String msg) { public void warn(String msg) {
logger.warn(msg); logger.warn(msg);
} }
@Override
public void warn(String msg, Throwable cause) { public void warn(String msg, Throwable cause) {
logger.warn(msg, cause); logger.warn(msg, cause);
} }

View File

@ -23,10 +23,11 @@
package org.jboss.netty.util; package org.jboss.netty.util;
import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
public class NamePreservingRunnable implements Runnable { public class NamePreservingRunnable implements Runnable {
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLogger.getLogger(NamePreservingRunnable.class); InternalLoggerFactory.getInstance(NamePreservingRunnable.class);
private final String newName; private final String newName;
private final Runnable runnable; private final Runnable runnable;