类 AbstractLogger
- java.lang.Object
-
- cn.sliew.milky.log.AbstractLogger
-
- 所有已实现的接口:
Logger,Serializable
- 直接已知子类:
NoLogger,Slf4jLogger,StdOutLogger
public abstract class AbstractLogger extends Object implements Logger, Serializable
A skeletal implementation ofLogger. This class implements all methods that have aLogLevelparameter by default to call specific logger methods such asLogger.info(String)orLogger.isInfoEnabled().- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractLogger(String name)Creates a new instance.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddebug(Throwable t)Log an exception (throwable) at the DEBUG level.voiderror(Throwable t)Log an exception (throwable) at the ERROR level.voidinfo(Throwable t)Log an exception (throwable) at the INFO level.booleanisEnabled(LogLevel level)Whether the logger instance enabled for the specifiedlevel.voidlog(LogLevel level, String msg)Log a message at the specifiedlevel.voidlog(LogLevel level, String format, Object arg)Log a message at the specifiedlevelaccording to the specified format and argument.voidlog(LogLevel level, String format, Object... arguments)Log a message at the specifiedlevelaccording to the specified format and arguments.voidlog(LogLevel level, String format, Object argA, Object argB)Log a message at the specifiedlevelaccording to the specified format and arguments.voidlog(LogLevel level, String msg, Throwable cause)Log an exception (throwable) at the specifiedlevelwith an accompanying message.voidlog(LogLevel level, Throwable cause)Log an exception (throwable) at the specifiedlevel.Stringname()Return the name of thisLoggerinstance.protected ObjectreadResolve()StringtoString()voidtrace(Throwable t)Log an exception (throwable) at the TRACE level.voidwarn(Throwable t)Log an exception (throwable) at the WARN level.
-
-
-
构造器详细资料
-
AbstractLogger
protected AbstractLogger(String name)
Creates a new instance.
-
-
方法详细资料
-
isEnabled
public boolean isEnabled(LogLevel level)
从接口复制的说明:LoggerWhether the logger instance enabled for the specifiedlevel.
-
trace
public void trace(Throwable t)
从接口复制的说明:LoggerLog an exception (throwable) at the TRACE level.
-
debug
public void debug(Throwable t)
从接口复制的说明:LoggerLog an exception (throwable) at the DEBUG level.
-
info
public void info(Throwable t)
从接口复制的说明:LoggerLog an exception (throwable) at the INFO level.
-
warn
public void warn(Throwable t)
从接口复制的说明:LoggerLog an exception (throwable) at the WARN level.
-
error
public void error(Throwable t)
从接口复制的说明:LoggerLog an exception (throwable) at the ERROR level.
-
log
public void log(LogLevel level, String msg, Throwable cause)
从接口复制的说明:LoggerLog an exception (throwable) at the specifiedlevelwith an accompanying message.
-
log
public void log(LogLevel level, Throwable cause)
从接口复制的说明:LoggerLog an exception (throwable) at the specifiedlevel.
-
log
public void log(LogLevel level, String msg)
从接口复制的说明:LoggerLog a message at the specifiedlevel.
-
log
public void log(LogLevel level, String format, Object arg)
从接口复制的说明:LoggerLog 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.
-
log
public void log(LogLevel level, String format, Object argA, Object argB)
从接口复制的说明:LoggerLog 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.
-
log
public void log(LogLevel level, String format, Object... arguments)
从接口复制的说明:LoggerLog 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.
-
readResolve
protected Object readResolve() throws ObjectStreamException
-
-