Package software.amazon.awssdk.utils
Class Logger
- java.lang.Object
-
- software.amazon.awssdk.utils.Logger
-
public final class Logger extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(Supplier<String> msg)
Checks if debug is enabled and if so logs the supplied messagevoid
debug(Supplier<String> msg, Throwable throwable)
Checks if debug is enabled and if so logs the supplied message and exceptionvoid
error(Supplier<String> msg)
Checks if error is enabled and if so logs the supplied messagevoid
error(Supplier<String> msg, Throwable throwable)
Checks if error is enabled and if so logs the supplied message and exceptionvoid
info(Supplier<String> msg)
Checks if info is enabled and if so logs the supplied messagevoid
info(Supplier<String> msg, Throwable throwable)
Checks if info is enabled and if so logs the supplied message and exceptionboolean
isLoggingLevelEnabled(String logLevel)
Determines if the log-level passed is enabledboolean
isLoggingLevelEnabled(org.slf4j.event.Level logLevel)
Determines if the provided log-level is enabled.void
log(org.slf4j.event.Level logLevel, Supplier<String> msg)
Log a message at the given log level (if it is enabled).org.slf4j.Logger
logger()
static Logger
loggerFor(Class<?> clz)
Static factory to get a logger instance for a given classstatic Logger
loggerFor(String name)
Static factory to get a logger instance with a specific name.void
trace(Supplier<String> msg)
Checks if trace is enabled and if so logs the supplied messagevoid
trace(Supplier<String> msg, Throwable throwable)
Checks if trace is enabled and if so logs the supplied message and exceptionvoid
warn(Supplier<String> msg)
Checks if warn is enabled and if so logs the supplied messagevoid
warn(Supplier<String> msg, Throwable throwable)
Checks if warn is enabled and if so logs the supplied message and exception
-
-
-
Method Detail
-
logger
public org.slf4j.Logger logger()
-
info
public void info(Supplier<String> msg)
Checks if info is enabled and if so logs the supplied message- Parameters:
msg
- - supplier for the log message
-
info
public void info(Supplier<String> msg, Throwable throwable)
Checks if info is enabled and if so logs the supplied message and exception- Parameters:
msg
- - supplier for the log messagethrowable
- - a throwable to log
-
error
public void error(Supplier<String> msg)
Checks if error is enabled and if so logs the supplied message- Parameters:
msg
- - supplier for the log message
-
error
public void error(Supplier<String> msg, Throwable throwable)
Checks if error is enabled and if so logs the supplied message and exception- Parameters:
msg
- - supplier for the log messagethrowable
- - a throwable to log
-
debug
public void debug(Supplier<String> msg)
Checks if debug is enabled and if so logs the supplied message- Parameters:
msg
- - supplier for the log message
-
debug
public void debug(Supplier<String> msg, Throwable throwable)
Checks if debug is enabled and if so logs the supplied message and exception- Parameters:
msg
- - supplier for the log messagethrowable
- - a throwable to log
-
warn
public void warn(Supplier<String> msg)
Checks if warn is enabled and if so logs the supplied message- Parameters:
msg
- - supplier for the log message
-
warn
public void warn(Supplier<String> msg, Throwable throwable)
Checks if warn is enabled and if so logs the supplied message and exception- Parameters:
msg
- - supplier for the log messagethrowable
- - a throwable to log
-
trace
public void trace(Supplier<String> msg)
Checks if trace is enabled and if so logs the supplied message- Parameters:
msg
- - supplier for the log message
-
trace
public void trace(Supplier<String> msg, Throwable throwable)
Checks if trace is enabled and if so logs the supplied message and exception- Parameters:
msg
- - supplier for the log messagethrowable
- - a throwable to log
-
isLoggingLevelEnabled
public boolean isLoggingLevelEnabled(org.slf4j.event.Level logLevel)
Determines if the provided log-level is enabled.- Parameters:
logLevel
- the SLF4J log level enum- Returns:
- whether that level is enabled
-
isLoggingLevelEnabled
public boolean isLoggingLevelEnabled(String logLevel)
Determines if the log-level passed is enabled- Parameters:
logLevel
- a string representation of the log level, e.g. "debug"- Returns:
- whether or not that level is enable
-
log
public void log(org.slf4j.event.Level logLevel, Supplier<String> msg)
Log a message at the given log level (if it is enabled).- Parameters:
logLevel
- the SLF4J log levelmsg
- supplier for the log message
-
loggerFor
public static Logger loggerFor(Class<?> clz)
Static factory to get a logger instance for a given class- Parameters:
clz
- - class to get the logger for- Returns:
- a Logger instance
-
-