LazyArgs

public final class LazyArgs

Static utility methods for lazy argument evaluation in Flogger. The lazy method allows lambda expressions to be "cast" to the LazyArg interface.

In cases where the log statement is strongly expected to always be enabled (e.g. unconditional logging at warning or above) it may not be worth using lazy evaluation because any work required to evaluate arguments will happen anyway.

If lambdas are available, users should prefer using this class rather than explicitly creating LazyArg instances.

Functions

Link copied to clipboard
public static LazyArg<T> lazy<T>(LazyArg<T> lambdaOrMethodReference)
Coerces a lambda expression or method reference to return a lazily evaluated logging argument.