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. AllLogger
instances from this API should be thread-safe.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Logger
atDebug()
Service access APILogger
atError()
Service access APILogger
atInfo()
Service access APILogger
atTrace()
Service access APILogger
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
-
atDebug
Logger atDebug()
Service access API- Returns:
- Logger instance with
Level.DEBUG
severity level
-
atError
Logger atError()
Service access API- Returns:
- Logger instance with
Level.ERROR
severity level
-
atInfo
Logger atInfo()
Service access API- Returns:
- Logger instance with
Level.INFO
severity level
-
atTrace
Logger atTrace()
Service access API- Returns:
- Logger instance with
Level.TRACE
severity level
-
atWarn
Logger atWarn()
Service access API- Returns:
- Logger instance with
Level.WARN
severity 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.
-
-