public final class Logs extends Object
| Constructor and Description |
|---|
Logs() |
| Modifier and Type | Method and Description |
|---|---|
static void |
debug(Logger log,
Supplier logLineSupplier)
Writes a log line with the
DEBUG priority. |
static void |
debug(Logger log,
Supplier logLineSupplier,
Throwable throwable)
Writes a log line with the
DEBUG priority. |
public static void debug(Logger log,
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,
Supplier logLineSupplier,
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 © 2017 SAP SE. All Rights Reserved.