-
- All Implemented Interfaces:
-
com.king.logx.logger.ILogger
public final class CompositeLogger extends Logger
CompositeLogger可以同时管理多个Logger,提供更多的扩展性。
CompositeLogger can manage multiple Loggers simultaneously, providing greater extensibility.
通过removeLogger函数可以移除已添加过的Logger
通过removeAllLoggers函数可以移除所有的Logger
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerloggerCountprivate volatile LogFormatlastLogFormatprivate volatile IntegerlastOffset
-
Constructor Summary
Constructors Constructor Description CompositeLogger()
-
Method Summary
Modifier and Type Method Description final IntegerloggerCount()final LogFormatgetLastLogFormat()final UnitsetLastLogFormat(LogFormat lastLogFormat)final IntegergetLastOffset()final UnitsetLastOffset(Integer lastOffset)ILoggerformat(LogFormat logFormat)为下次日志调用设置一次性日志显示格式Set a one-time log display format for use on the next logging call. ILoggeroffset(Integer methodOffset)为下次日志调用设置一次性方法跟踪偏移量Set a one-time method trace offset for use on the next logging call. ILoggertag(String tag)为下次日志调用设置一次性标签Set a one-time tag for use on the next logging call. Unitv(String message, Object args)记录详细级别日志消息(可包含格式参数)Log a verbose message with optional format args. Unitv(Throwable t, String message, Object args)记录详细级别异常和消息(可包含格式参数)Log a verbose exception and a message with optional format args. Unitv(Throwable t)记录详细级别异常Log a verbose exception. Unitd(String message, Object args)记录调试级别日志消息(可包含格式参数)Log a debug message with optional format args. Unitd(Throwable t, String message, Object args)记录调试级别异常和消息(可包含格式参数)Log a debug exception and a message with optional format args. Unitd(Throwable t)记录调试级别异常Log a debug exception. Uniti(String message, Object args)记录信息级别日志消息(可包含格式参数)Log an info message with optional format args. Uniti(Throwable t, String message, Object args)记录信息级别异常和消息(可包含格式参数)Log an info exception and a message with optional format args. Uniti(Throwable t)记录信息级别异常Log an info exception. Unitw(String message, Object args)记录警告级别日志消息(可包含格式参数)Log a warning message with optional format args. Unitw(Throwable t, String message, Object args)记录警告级别异常和消息(可包含格式参数)Log a warning exception and a message with optional format args. Unitw(Throwable t)记录警告级别异常Log a warning exception. Unite(String message, Object args)记录错误级别日志消息(可包含格式参数)Log an error message with optional format args. Unite(Throwable t, String message, Object args)记录错误级别异常和消息(可包含格式参数)Log an error exception and a message with optional format args. Unite(Throwable t)记录错误级别异常Log an error exception. Unitwtf(String message, Object args)记录断言级别日志消息(可包含格式参数)Log an assert message with optional format args. Unitwtf(Throwable t, String message, Object args)记录断言级别异常和消息(可包含格式参数)Log an assert exception and a message with optional format args. Unitwtf(Throwable t)记录断言级别异常Log an assert exception. Unitlog(Integer priority, String message)按指定优先级记录日志消息Log at prioritya message.Unitlog(Integer priority, Throwable t, String message)按指定优先级记录异常和消息Log at priorityan exception and a message.Unitlog(Integer priority, Throwable t)按指定优先级记录异常Log at priorityan exception.final UnitaddLogger(Logger logger)添加新的日志记录器Add new logger. final UnitaddLogger(Logger loggers)批量添加多个日志记录器Adds new loggers. final UnitremoveLogger(Logger logger)移除已添加的日志记录器Remove a added logger. final UnitremoveAllLoggers()移除所有已添加的日志记录器Remove all added loggers. -
-
Method Detail
-
loggerCount
final Integer loggerCount()
-
getLastLogFormat
final LogFormat getLastLogFormat()
-
setLastLogFormat
final Unit setLastLogFormat(LogFormat lastLogFormat)
-
getLastOffset
final Integer getLastOffset()
-
setLastOffset
final Unit setLastOffset(Integer lastOffset)
-
format
ILogger format(LogFormat logFormat)
为下次日志调用设置一次性日志显示格式
Set a one-time log display format for use on the next logging call.
-
offset
ILogger offset(Integer methodOffset)
为下次日志调用设置一次性方法跟踪偏移量
Set a one-time method trace offset for use on the next logging call.
-
v
Unit v(String message, Object args)
记录详细级别日志消息(可包含格式参数)
Log a verbose message with optional format args.
-
v
Unit v(Throwable t, String message, Object args)
记录详细级别异常和消息(可包含格式参数)
Log a verbose exception and a message with optional format args.
-
d
Unit d(String message, Object args)
记录调试级别日志消息(可包含格式参数)
Log a debug message with optional format args.
-
d
Unit d(Throwable t, String message, Object args)
记录调试级别异常和消息(可包含格式参数)
Log a debug exception and a message with optional format args.
-
i
Unit i(String message, Object args)
记录信息级别日志消息(可包含格式参数)
Log an info message with optional format args.
-
i
Unit i(Throwable t, String message, Object args)
记录信息级别异常和消息(可包含格式参数)
Log an info exception and a message with optional format args.
-
w
Unit w(String message, Object args)
记录警告级别日志消息(可包含格式参数)
Log a warning message with optional format args.
-
w
Unit w(Throwable t, String message, Object args)
记录警告级别异常和消息(可包含格式参数)
Log a warning exception and a message with optional format args.
-
e
Unit e(String message, Object args)
记录错误级别日志消息(可包含格式参数)
Log an error message with optional format args.
-
e
Unit e(Throwable t, String message, Object args)
记录错误级别异常和消息(可包含格式参数)
Log an error exception and a message with optional format args.
-
wtf
Unit wtf(String message, Object args)
记录断言级别日志消息(可包含格式参数)
Log an assert message with optional format args.
-
wtf
Unit wtf(Throwable t, String message, Object args)
记录断言级别异常和消息(可包含格式参数)
Log an assert exception and a message with optional format args.
-
log
Unit log(Integer priority, Throwable t, String message)
按指定优先级记录异常和消息
Log at
priorityan exception and a message.
-
removeLogger
final Unit removeLogger(Logger logger)
移除已添加的日志记录器
Remove a added logger.
-
removeAllLoggers
final Unit removeAllLoggers()
移除所有已添加的日志记录器
Remove all added loggers.
-
-
-
-