Package io.microsphere.logging
Class AbstractLogger
- java.lang.Object
-
- io.microsphere.logging.AbstractLogger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLogger(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.String format, java.lang.Object... arguments)Log a message at the DEBUG level according to the specified format and arguments.voiderror(java.lang.String format, java.lang.Object... arguments)Log a message at the ERROR level according to the specified format and arguments.java.lang.StringgetName()Return the name of thisLoggerinstance.voidinfo(java.lang.String format, java.lang.Object... arguments)Log a message at the INFO level according to the specified format and arguments.protected voidlog(java.util.function.Consumer<java.lang.String> messageHandler, java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> messageThrowableHandler, java.lang.String format, java.lang.Object... arguments)protected java.lang.StringresolveMessage(java.lang.String format, java.lang.Object... arguments)Resolve the format messagevoidtrace(java.lang.String format, java.lang.Object... arguments)Log a message at the TRACE level according to the specified format and arguments.voidwarn(java.lang.String format, java.lang.Object... arguments)Log a message at the WARN level according to the specified format and arguments.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.logging.Logger
debug, debug, error, error, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, warn, warn
-
-
-
-
Method Detail
-
getName
public final java.lang.String getName()
Description copied from interface:LoggerReturn the name of thisLoggerinstance.
-
trace
public void trace(java.lang.String format, java.lang.Object... arguments)Description copied from interface:LoggerLog a message at the TRACE level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the TRACE level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for TRACE.
-
debug
public void debug(java.lang.String format, java.lang.Object... arguments)Description copied from interface:LoggerLog a message at the DEBUG level according to the specified format and arguments.
-
info
public void info(java.lang.String format, java.lang.Object... arguments)Description copied from interface:LoggerLog a message at the INFO level according to the specified format and arguments.
-
warn
public void warn(java.lang.String format, java.lang.Object... arguments)Description copied from interface:LoggerLog a message at the WARN level according to the specified format and arguments.
-
error
public void error(java.lang.String format, java.lang.Object... arguments)Description copied from interface:LoggerLog a message at the ERROR level according to the specified format and arguments.
-
log
protected void log(java.util.function.Consumer<java.lang.String> messageHandler, java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> messageThrowableHandler, java.lang.String format, java.lang.Object... arguments)- Parameters:
messageHandler- only message to logmessageThrowableHandler- message andThrowableto logformat- the format message or regular messagearguments- zero or more arguments for the format pattern
-
resolveMessage
protected java.lang.String resolveMessage(java.lang.String format, java.lang.Object... arguments)Resolve the format message- Parameters:
format- the format messagearguments- zero or more arguments for the format pattern- Returns:
- non-null
-
-