It's really two things:
1) Flogger's original design predates Java8 (by about 4 years) and lambdas didn't exist then, so this would have been problematic then.
There's also the problem that Flogger's core API is compatible all the way back to Java 6, so adding lambdas would break backwards compatibility.
However, the real issue is that it's basically impossible to use lambdas in the way you describe, since it just doesn't make for a practical API.
Consider the methods that would be needed to support this. Assume that you start with the current Flogger log methods:
log(String, Object)
log(String, Object, Object)
log(String, Object, Object, Object)
log(String, Object, Object, Object, Object, ...)
So now you need to ask "what is a lambda?", "what type is it?" and "what should the methods look like to accommodate this?"
Firstly, a lambda is not a real thing, it's compiler smoke & mirrors. The "type" of a lambda is whatever the receiver expects to which it can be coerced.
So "log("Hello %s", () -> expensive())" can only compile if the log method looks like "log(String msg, Supplier<?> lazyArg)".
But what about two arguments:
log("Hello %s, World %s", () -> expensive(), cheap)
That only compiles if you have:
log(String, Supplier<?>, Object)
but now you also need to handle other combinations like:
log(String, Object, Supplier<?> lazyArg)
log(String, Supplier<?>, Supplier<?>)
For 3 arguments, you need 8 methods for all combinations and so on. Since Flogger avoids varargs up to 10 parameters, you'd need > 1000 new methods.
Even worse, once you get an arbitrary number of methods using varargs, it stops working completely and stops compiling.
And finally, even if you got all of that working, what if I wanted to log something that just happens to be a "Supplier" ? I don't want it's value to be logged, I want the Supplier itself to be logged.
No API can tell the difference here so will get it wrong in at least some cases.
Note that the JDK logger *doesn't* do what you describe, it wants a lambda for the entire message, not a message plus separate lazy args.
This is problematic because it encourages logging things serialized as strings, and Flogger supports structured logging (only the backend cares about formatting), so this approach would go against that aim.
But ... having said all that, Flogger does support lambdas, and it supports them for free via "lazy()"
Look at the implementation of the "lazy()" method. It's completely *empty*.
All "lazy()" does is present a new type (one that's compatible with Supplier, but not Supplier itself) so that a given lamdba can be "coerced" into that type.
Now, with the known special type in hand, Flogger can use "instanceof" to figure out which arguments are lazy without any ambiguity.
So, as you can see, it's really not feasible to do what you're suggesting (sadly) and something like "lazy()" is a very "cheap" way to solve the problem while retaining structured parameters.
Hope this help explain things,
David