Package io.microsphere.logging
Class AbstractLogger
- java.lang.Object
-
- io.microsphere.logging.AbstractLogger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLogger(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(java.lang.String format, java.lang.Object... arguments)
Log a message at the DEBUG level according to the specified format and arguments.void
error(java.lang.String format, java.lang.Object... arguments)
Log a message at the ERROR level according to the specified format and arguments.java.lang.String
getName()
Return the name of thisLogger
instance.void
info(java.lang.String format, java.lang.Object... arguments)
Log a message at the INFO level according to the specified format and arguments.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)
protected java.lang.String
resolveMessage(java.lang.String format, java.lang.Object... arguments)
Resolve the format messagevoid
trace(java.lang.String format, java.lang.Object... arguments)
Log a message at the TRACE level according to the specified format and arguments.void
warn(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:Logger
Return the name of thisLogger
instance.
-
trace
public void trace(java.lang.String format, java.lang.Object... arguments)
Description copied from interface:Logger
Log 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:Logger
Log 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:Logger
Log 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:Logger
Log 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:Logger
Log 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 andThrowable
to 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
-
-