Package stroom.query.util
Interface LambdaLogger
-
- All Known Implementing Classes:
BasicLambdaLogger
public interface LambdaLogger
-
-
Method Summary
Modifier and Type Method Description static java.lang.StringbuildMessage(java.lang.String format, java.lang.Object... args)Constructs a formatted message string using a format string that takes the same placeholders as SLF4J, e.g.voiddebug(java.util.function.Supplier<java.lang.String> message)voiddebug(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)voiddoIfDebugEnabled(java.lang.Runnable work)Performs work only if DEBUG is enabled.voiddoIfInfoEnabled(java.lang.Runnable work)Performs work only if INFO is enabled.voiddoIfTraceEnabled(java.lang.Runnable work)Performs work only if TRACE is enabled.voiderror(java.util.function.Supplier<java.lang.String> message)voiderror(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)voidinfo(java.util.function.Supplier<java.lang.String> message)voidinfo(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)default voidlogDurationIfDebugEnabled(java.lang.Runnable timedWork, java.lang.String workDescription)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work.voidlogDurationIfDebugEnabled(java.lang.Runnable timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work.default <T> TlogDurationIfDebugEnabled(java.util.function.Supplier<T> timedWork, java.lang.String workDescription)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work.<T> TlogDurationIfDebugEnabled(java.util.function.Supplier<T> timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work.default voidlogDurationIfInfoEnabled(java.lang.Runnable timedWork, java.lang.String workDescription)Performs timedWork and if INFO is enabled, logs the time taken to do that work.voidlogDurationIfInfoEnabled(java.lang.Runnable timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if INFO is enabled, logs the time taken to do that work.default <T> TlogDurationIfInfoEnabled(java.util.function.Supplier<T> timedWork, java.lang.String workDescription)Performs timedWork and if INFO is enabled, logs the time taken to do that work.<T> TlogDurationIfInfoEnabled(java.util.function.Supplier<T> timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if INFO is enabled, logs the time taken to do that work.default voidlogDurationIfTraceEnabled(java.lang.Runnable timedWork, java.lang.String workDescription)Performs timedWork and if TRACE is enabled, logs the time taken to do that work.voidlogDurationIfTraceEnabled(java.lang.Runnable timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if TRACE is enabled, logs the time taken to do that work.default <T> TlogDurationIfTraceEnabled(java.util.function.Supplier<T> timedWork, java.lang.String workDescription)Performs timedWork and if TRACE is enabled, logs the time taken to do that work<T> TlogDurationIfTraceEnabled(java.util.function.Supplier<T> timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if TRACE is enabled, logs the time taken to do that work.voidtrace(java.util.function.Supplier<java.lang.String> message)voidtrace(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)voidwarn(java.util.function.Supplier<java.lang.String> message)voidwarn(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)
-
-
-
Method Detail
-
trace
void trace(java.util.function.Supplier<java.lang.String> message)
-
trace
void trace(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)
-
debug
void debug(java.util.function.Supplier<java.lang.String> message)
-
debug
void debug(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)
-
info
void info(java.util.function.Supplier<java.lang.String> message)
-
info
void info(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)
-
warn
void warn(java.util.function.Supplier<java.lang.String> message)
-
warn
void warn(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)
-
error
void error(java.util.function.Supplier<java.lang.String> message)
-
error
void error(java.util.function.Supplier<java.lang.String> message, java.lang.Throwable t)
-
logDurationIfTraceEnabled
default <T> T logDurationIfTraceEnabled(java.util.function.Supplier<T> timedWork, java.lang.String workDescription)Performs timedWork and if TRACE is enabled, logs the time taken to do that work- Type Parameters:
T- The type of the result of the work- Parameters:
timedWork- Work to perform and to time if requiredworkDescription- The name of the work to be added to the log message- Returns:
- The result of the work
-
logDurationIfTraceEnabled
<T> T logDurationIfTraceEnabled(java.util.function.Supplier<T> timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if TRACE is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Type Parameters:
T- The type of the result of the work- Parameters:
timedWork- Work to perform and to time if requiredworkDescriptionSupplier- A supplier of the description of the work to be added to the log message- Returns:
- The result of the work
-
logDurationIfDebugEnabled
default <T> T logDurationIfDebugEnabled(java.util.function.Supplier<T> timedWork, java.lang.String workDescription)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Type Parameters:
T- The type of the result of the work- Parameters:
timedWork- Work to perform and to time if requiredworkDescription- The name of the work to be added to the log message- Returns:
- The result of the work
-
logDurationIfDebugEnabled
<T> T logDurationIfDebugEnabled(java.util.function.Supplier<T> timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Type Parameters:
T- The type of the result of the work- Parameters:
timedWork- Work to perform and to time if requiredworkDescriptionSupplier- The name of the work to be added to the log message- Returns:
- The result of the work
-
logDurationIfInfoEnabled
default <T> T logDurationIfInfoEnabled(java.util.function.Supplier<T> timedWork, java.lang.String workDescription)Performs timedWork and if INFO is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Type Parameters:
T- The type of the result of the work- Parameters:
timedWork- Work to perform and to time if requiredworkDescription- The name of the work to be added to the log message- Returns:
- The result of the work
-
logDurationIfInfoEnabled
<T> T logDurationIfInfoEnabled(java.util.function.Supplier<T> timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if INFO is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Type Parameters:
T- The type of the result of the work- Parameters:
timedWork- Work to perform and to time if requiredworkDescriptionSupplier- The name of the work to be added to the log message- Returns:
- The result of the work
-
logDurationIfTraceEnabled
default void logDurationIfTraceEnabled(java.lang.Runnable timedWork, java.lang.String workDescription)Performs timedWork and if TRACE is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Parameters:
timedWork- Work to perform and to time if requiredworkDescription- The name of the work to be added to the log message
-
logDurationIfTraceEnabled
void logDurationIfTraceEnabled(java.lang.Runnable timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if TRACE is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Parameters:
timedWork- Work to perform and to time if requiredworkDescriptionSupplier- The name of the work to be added to the log message
-
logDurationIfDebugEnabled
default void logDurationIfDebugEnabled(java.lang.Runnable timedWork, java.lang.String workDescription)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Parameters:
timedWork- Work to perform and to time if requiredworkDescription- The name of the work to be added to the log message
-
logDurationIfDebugEnabled
void logDurationIfDebugEnabled(java.lang.Runnable timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if DEBUG is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Parameters:
timedWork- Work to perform and to time if requiredworkDescriptionSupplier- The name of the work to be added to the log message
-
logDurationIfInfoEnabled
default void logDurationIfInfoEnabled(java.lang.Runnable timedWork, java.lang.String workDescription)Performs timedWork and if INFO is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Parameters:
timedWork- Work to perform and to time if requiredworkDescription- The name of the work to be added to the log message
-
logDurationIfInfoEnabled
void logDurationIfInfoEnabled(java.lang.Runnable timedWork, java.util.function.Supplier<java.lang.String> workDescriptionSupplier)Performs timedWork and if INFO is enabled, logs the time taken to do that work. This cannot be used where the work throws a checked exception.- Parameters:
timedWork- Work to perform and to time if requiredworkDescriptionSupplier- The name of the work to be added to the log message
-
doIfTraceEnabled
void doIfTraceEnabled(java.lang.Runnable work)
Performs work only if TRACE is enabled.- Parameters:
work- The work to perform.
-
doIfDebugEnabled
void doIfDebugEnabled(java.lang.Runnable work)
Performs work only if DEBUG is enabled.- Parameters:
work- The work to perform.
-
doIfInfoEnabled
void doIfInfoEnabled(java.lang.Runnable work)
Performs work only if INFO is enabled.- Parameters:
work- The work to perform.
-
buildMessage
static java.lang.String buildMessage(java.lang.String format, java.lang.Object... args)Constructs a formatted message string using a format string that takes the same placeholders as SLF4J, e.g. "Function called with name {} and value {}"- Parameters:
format- SLF4J style format stringargs- The values for any placeholders in the message format- Returns:
- A formatted message
-
-