Package io.netty.util.internal.logging
Class AbstractInternalLogger
- java.lang.Object
-
- io.netty.util.internal.logging.AbstractInternalLogger
-
- All Implemented Interfaces:
InternalLogger,java.io.Serializable
public abstract class AbstractInternalLogger extends java.lang.Object implements InternalLogger, java.io.Serializable
A skeletal implementation ofInternalLogger. This class implements all methods that have aInternalLogLevelparameter by default to call specific logger methods such asInternalLogger.info(String)orInternalLogger.isInfoEnabled().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractInternalLogger(java.lang.String name)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.Throwable t)Log an exception (throwable) at the DEBUG level.voiderror(java.lang.Throwable t)Log an exception (throwable) at the ERROR level.voidinfo(java.lang.Throwable t)Log an exception (throwable) at the INFO level.booleanisEnabled(InternalLogLevel level)Is the logger instance enabled for the specifiedlevel?voidlog(InternalLogLevel level, java.lang.String msg)Log a message at the specifiedlevel.voidlog(InternalLogLevel level, java.lang.String format, java.lang.Object arg)Log a message at the specifiedlevelaccording to the specified format and argument.voidlog(InternalLogLevel level, java.lang.String format, java.lang.Object... arguments)Log a message at the specifiedlevelaccording to the specified format and arguments.voidlog(InternalLogLevel level, java.lang.String format, java.lang.Object argA, java.lang.Object argB)Log a message at the specifiedlevelaccording to the specified format and arguments.voidlog(InternalLogLevel level, java.lang.String msg, java.lang.Throwable cause)Log an exception (throwable) at the specifiedlevelwith an accompanying message.voidlog(InternalLogLevel level, java.lang.Throwable cause)Log an exception (throwable) at the specifiedlevel.java.lang.Stringname()Return the name of thisInternalLoggerinstance.protected java.lang.ObjectreadResolve()java.lang.StringtoString()voidtrace(java.lang.Throwable t)Log an exception (throwable) at the TRACE level.voidwarn(java.lang.Throwable t)Log an exception (throwable) at the WARN level.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.util.internal.logging.InternalLogger
debug, debug, debug, debug, debug, error, error, error, error, error, info, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn
-
-
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:InternalLoggerReturn the name of thisInternalLoggerinstance.- Specified by:
namein interfaceInternalLogger- Returns:
- name of this logger instance
-
isEnabled
public boolean isEnabled(InternalLogLevel level)
Description copied from interface:InternalLoggerIs the logger instance enabled for the specifiedlevel?- Specified by:
isEnabledin interfaceInternalLogger- Returns:
- True if this Logger is enabled for the specified
level, false otherwise.
-
trace
public void trace(java.lang.Throwable t)
Description copied from interface:InternalLoggerLog an exception (throwable) at the TRACE level.- Specified by:
tracein interfaceInternalLogger- Parameters:
t- the exception (throwable) to log
-
debug
public void debug(java.lang.Throwable t)
Description copied from interface:InternalLoggerLog an exception (throwable) at the DEBUG level.- Specified by:
debugin interfaceInternalLogger- Parameters:
t- the exception (throwable) to log
-
info
public void info(java.lang.Throwable t)
Description copied from interface:InternalLoggerLog an exception (throwable) at the INFO level.- Specified by:
infoin interfaceInternalLogger- Parameters:
t- the exception (throwable) to log
-
warn
public void warn(java.lang.Throwable t)
Description copied from interface:InternalLoggerLog an exception (throwable) at the WARN level.- Specified by:
warnin interfaceInternalLogger- Parameters:
t- the exception (throwable) to log
-
error
public void error(java.lang.Throwable t)
Description copied from interface:InternalLoggerLog an exception (throwable) at the ERROR level.- Specified by:
errorin interfaceInternalLogger- Parameters:
t- the exception (throwable) to log
-
log
public void log(InternalLogLevel level, java.lang.String msg, java.lang.Throwable cause)
Description copied from interface:InternalLoggerLog an exception (throwable) at the specifiedlevelwith an accompanying message.- Specified by:
login interfaceInternalLoggermsg- the message accompanying the exceptioncause- the exception (throwable) to log
-
log
public void log(InternalLogLevel level, java.lang.Throwable cause)
Description copied from interface:InternalLoggerLog an exception (throwable) at the specifiedlevel.- Specified by:
login interfaceInternalLoggercause- the exception (throwable) to log
-
log
public void log(InternalLogLevel level, java.lang.String msg)
Description copied from interface:InternalLoggerLog a message at the specifiedlevel.- Specified by:
login interfaceInternalLoggermsg- the message string to be logged
-
log
public void log(InternalLogLevel level, java.lang.String format, java.lang.Object arg)
Description copied from interface:InternalLoggerLog a message at the specifiedlevelaccording to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the specified
level.- Specified by:
login interfaceInternalLoggerformat- the format stringarg- the argument
-
log
public void log(InternalLogLevel level, java.lang.String format, java.lang.Object argA, java.lang.Object argB)
Description copied from interface:InternalLoggerLog a message at the specifiedlevelaccording to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the specified
level.- Specified by:
login interfaceInternalLoggerformat- the format stringargA- the first argumentargB- the second argument
-
log
public void log(InternalLogLevel level, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:InternalLoggerLog a message at the specifiedlevelaccording to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the specified
level. However, this variant incurs the hidden (and relatively small) cost of creating anObject[]before invoking the method, even if this logger is disabled for the specifiedlevel. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost.- Specified by:
login interfaceInternalLoggerformat- the format stringarguments- a list of 3 or more arguments
-
readResolve
protected java.lang.Object readResolve() throws java.io.ObjectStreamException- Throws:
java.io.ObjectStreamException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-