-
- All Implemented Interfaces:
-
com.king.logx.logger.ILogger
public final class CompositeLogger extends Logger
CompositeLogger可以同时管理多个Logger,提供更多的扩展性。
通过removeLogger函数可以移除已添加过的Logger
通过removeAllLoggers函数可以移除所有的Logger
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerloggerCount
-
Constructor Summary
Constructors Constructor Description CompositeLogger()
-
Method Summary
Modifier and Type Method Description final IntegerloggerCount()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 priorityan message.Unitlog(Integer priority, Throwable t, String message)Log at priorityan exception and a message.Unitlog(Integer priority, Throwable t)Log at priorityan exception.Unitlog(Integer priority, String tag, String message, Throwable t)Write a log message to its destination. 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()
-
offset
ILogger offset(Integer methodOffset)
Set a one-time method trace offset for use on the next logging call.
-
v
Unit v(Throwable t, String message, Object args)
Log a verbose exception and a 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(Throwable t, String message, Object args)
Log an info exception and a 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(Throwable t, String message, Object args)
Log an error exception and a 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.
-
log
Unit log(Integer priority, String tag, String message, Throwable t)
Write a log message to its destination. Called for all level-specific methods by default.
- Parameters:
priority- Log level.tag- Explicit or inferred tag.message- Formatted log message.t- Accompanying exceptions.
-
removeLogger
final Unit removeLogger(Logger logger)
Remove a added logger.
-
removeAllLoggers
final Unit removeAllLoggers()
Remove all added loggers.
-
-
-
-