Package de.hybris.platform.util.logging
Class Logs
java.lang.Object
de.hybris.platform.util.logging.Logs
Helper methods for improving usability of Log4j logger
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Logs
public Logs()
-
-
Method Details
-
debug
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, Supplier logLineSupplier, 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
-