public final class Logs
extends java.lang.Object
| Constructor and Description |
|---|
Logs() |
| Modifier and Type | Method and Description |
|---|---|
static void |
debug(Logger log,
java.util.function.Supplier logLineSupplier)
Writes a log line with the
DEBUG priority. |
static void |
debug(Logger log,
java.util.function.Supplier logLineSupplier,
java.lang.Throwable throwable)
Writes a log line with the
DEBUG priority. |
public static void debug(Logger log,
java.util.function.Supplier logLineSupplier)
DEBUG priority. Line might be provided by lambda expression, which is evaluated
only when DEBUG is enabled on a given logger. It delegates to Logger#debug(Object).
This method allows you to write:
Logs.debug(LOG, () -> "Something " + calculateSomething() + " is wrong.");
calculateSomething() will be called only when DEBUG is enabled.log - logger to uselogLineSupplier - log line supplierpublic static void debug(Logger log,
java.util.function.Supplier logLineSupplier,
java.lang.Throwable throwable)
DEBUG priority. Line might be provided by lambda expression, which is evaluated
only when DEBUG is enabled on a given logger. It delegates to Logger#debug(Object).
This method allows you to write:
Logs.debug(LOG, () -> "Something " + calculateSomething() + " is wrong.", exception);
calculateSomething() will be called only when DEBUG is enabled.log - logger to uselogLineSupplier - log line supplierthrowable - throwable to logCopyright © 2018 SAP SE. All Rights Reserved.