public class JDALogger
extends java.lang.Object
LoggerFactory
if present,
or an instance of a custom SimpleLogger
(From slf4j-simple).
It also has the utility method getLazyString(LazyEvaluation)
which is used to lazily construct Strings for Logging.
Modifier and Type | Class | Description |
---|---|---|
static interface |
JDALogger.LazyEvaluation |
Functional interface used for
getLazyString(LazyEvaluation) to lazily construct a String. |
Modifier and Type | Field | Description |
---|---|---|
static boolean |
SLF4J_ENABLED |
Marks whether or not a SLF4J
StaticLoggerBinder was found. |
Modifier and Type | Method | Description |
---|---|---|
static java.lang.Object |
getLazyString(JDALogger.LazyEvaluation lazyLambda) |
Utility function to enable logging of complex statements more efficiently (lazy).
|
static org.slf4j.Logger |
getLog(java.lang.Class<?> clazz) |
Will get the
Logger for the given Class
or create and cache a fallback logger if there is no SLF4J implementation present. |
static org.slf4j.Logger |
getLog(java.lang.String name) |
Will get the
Logger with the given log-name
or create and cache a fallback logger if there is no SLF4J implementation present. |
public static final boolean SLF4J_ENABLED
StaticLoggerBinder
was found. If false, JDA will use its fallback logger.
public static org.slf4j.Logger getLog(java.lang.String name)
Logger
with the given log-name
or create and cache a fallback logger if there is no SLF4J implementation present.
The fallback logger will be an instance of a slightly modified version of SLF4Js SimpleLogger.
name
- The name of the Loggerpublic static org.slf4j.Logger getLog(java.lang.Class<?> clazz)
Logger
for the given Class
or create and cache a fallback logger if there is no SLF4J implementation present.
The fallback logger will be an instance of a slightly modified version of SLF4Js SimpleLogger.
clazz
- The class used for the Logger namepublic static java.lang.Object getLazyString(JDALogger.LazyEvaluation lazyLambda)
lazyLambda
- The Supplier used when evaluating the expression