Package elf4j
Interface Logger
-
- All Known Implementing Classes:
NoopLogger
public interface Logger
Logging service interface and access API as in the Java Service Provider Framework.
All
Logger
instances from this API should be thread-safe.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Logger
atDebug()
Service access APIdefault Logger
atError()
Service access APIdefault Logger
atInfo()
Service access APILogger
atLevel(Level level)
Service access APIdefault Logger
atTrace()
Service access APIdefault Logger
atWarn()
Service access APILevel
getLevel()
Service interface APIstatic Logger
instance()
Service access APIboolean
isEnabled()
Service interface APIvoid
log(Object message)
Service interface APIvoid
log(String message, Object... args)
Service interface APIvoid
log(Throwable t)
Service interface APIvoid
log(Throwable t, Object message)
Service interface APIvoid
log(Throwable t, String message, Object... args)
Service interface API
-
-
-
Method Detail
-
instance
static Logger instance()
Service access API- Returns:
- Logger instance with default name and Level
-
atLevel
Logger atLevel(Level level)
Service access API- Parameters:
level
- of the requested Logger instance- Returns:
- Logger instance of the specified level
-
getLevel
Level getLevel()
Service interface API- Returns:
- Severity level of the logger instance
-
isEnabled
boolean isEnabled()
Service interface API- Returns:
- true if the active logging of this instance enabled per configuration, false otherwise
-
log
void log(Object message)
Service interface API- Parameters:
message
- to be logged. If the actual type isSupplier
, the result ofSupplier.get()
, instead of themessage
itself, should be used to construct the final log message.
-
log
void log(String message, Object... args)
Service interface API- Parameters:
message
- to be loggedargs
- the arguments to replace the placeholders in the message. If any of the argument's actual type isSupplier
, the result ofSupplier.get()
, instead of the argument itself, should be used to construct the final log message.
-
log
void log(Throwable t)
Service interface API- Parameters:
t
- the Throwable to be logged
-
log
void log(Throwable t, Object message)
Service interface API- Parameters:
t
- the Throwable to be loggedmessage
- the message to be logged. If the actual type isSupplier
, the result ofSupplier.get()
, instead of themessage
itself, should be used to construct the final log message.
-
log
void log(Throwable t, String message, Object... args)
Service interface API- Parameters:
t
- the Throwable to be loggedmessage
- the message to be loggedargs
- the arguments to replace the placeholders in the message. If any of argument's actual type isSupplier
, the result ofSupplier.get()
, instead of the argument itself, should be used to construct the final log message.
-
atTrace
default Logger atTrace()
Service access API- Returns:
- Logger instance with
Level.TRACE
severity level
-
atDebug
default Logger atDebug()
Service access API- Returns:
- Logger instance with
Level.DEBUG
severity level
-
atInfo
default Logger atInfo()
Service access API- Returns:
- Logger instance with
Level.INFO
severity level
-
atWarn
default Logger atWarn()
Service access API- Returns:
- Logger instance with
Level.WARN
severity level
-
atError
default Logger atError()
Service access API- Returns:
- Logger instance with
Level.ERROR
severity level
-
-