Package software.amazon.awssdk.utils
Class Logger
- java.lang.Object
-
- software.amazon.awssdk.utils.Logger
-
@SdkProtectedApi public final class Logger extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(Supplier<String> msg)Checks if debug is enabled and if so logs the supplied messagevoiddebug(Supplier<String> msg, Throwable throwable)Checks if debug is enabled and if so logs the supplied message and exceptionvoiderror(Supplier<String> msg)Checks if error is enabled and if so logs the supplied messagevoiderror(Supplier<String> msg, Throwable throwable)Checks if error is enabled and if so logs the supplied message and exceptionvoidinfo(Supplier<String> msg)Checks if info is enabled and if so logs the supplied messagevoidinfo(Supplier<String> msg, Throwable throwable)Checks if info is enabled and if so logs the supplied message and exceptionbooleanisLoggingLevelEnabled(String logLevel)Determines if the log-level passed is enabledbooleanisLoggingLevelEnabled(org.slf4j.event.Level logLevel)Determines if the provided log-level is enabled.voidlog(org.slf4j.event.Level logLevel, Supplier<String> msg)Log a message at the given log level (if it is enabled).org.slf4j.Loggerlogger()static LoggerloggerFor(Class<?> clz)Static factory to get a logger instance for a given classstatic LoggerloggerFor(String name)Static factory to get a logger instance with a specific name.voidtrace(Supplier<String> msg)Checks if trace is enabled and if so logs the supplied messagevoidtrace(Supplier<String> msg, Throwable throwable)Checks if trace is enabled and if so logs the supplied message and exceptionvoidwarn(Supplier<String> msg)Checks if warn is enabled and if so logs the supplied messagevoidwarn(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
-
-