Add lambda example to README
@@ -49,6 +49,11 @@ public class Example {
public static void main(String... args) {
String thing = args.length > 0 ? args[0] : "world";
LOGGER.info("Hello, {}!", thing);
+ LOGGER.debug("Got calculated value only if debug enabled: {}", () -> doSomeCalculation());
+ }
+
+ private static Object doSomeCalculation() {
+ // do some complicated calculation
}
}
```
