Package de.hybris.platform.util.logging
Class Logs
- java.lang.Object
-
- de.hybris.platform.util.logging.Logs
-
public final class Logs extends java.lang.ObjectHelper methods for improving usability of Log4j logger
-
-
Constructor Summary
Constructors Constructor Description Logs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddebug(org.apache.log4j.Logger log, java.util.function.Supplier logLineSupplier)Writes a log line with theDEBUGpriority.static voiddebug(org.apache.log4j.Logger log, java.util.function.Supplier logLineSupplier, java.lang.Throwable throwable)Writes a log line with theDEBUGpriority.
-
-
-
Method Detail
-
debug
public static void debug(org.apache.log4j.Logger log, java.util.function.Supplier logLineSupplier)Writes a log line with theDEBUGpriority. Line might be provided by lambda expression, which is evaluated only whenDEBUGis enabled on a given logger. It delegates toCategory.debug(Object).This method allows you to write:
Logs.debug(LOG, () -> "Something " + calculateSomething() + " is wrong.");calculateSomething()will be called only whenDEBUGis enabled.- Parameters:
log- logger to uselogLineSupplier- log line supplier
-
debug
public static void debug(org.apache.log4j.Logger log, java.util.function.Supplier logLineSupplier, java.lang.Throwable throwable)Writes a log line with theDEBUGpriority. Line might be provided by lambda expression, which is evaluated only whenDEBUGis enabled on a given logger. It delegates toCategory.debug(Object).This method allows you to write:
Logs.debug(LOG, () -> "Something " + calculateSomething() + " is wrong.", exception);calculateSomething()will be called only whenDEBUGis enabled.- Parameters:
log- logger to uselogLineSupplier- log line supplierthrowable- throwable to log
-
-