You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2017/01/17 20:54:11 UTC

[20/32] logging-log4j2 git commit: Add lambda example to README

Add lambda example to README


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b90495e5
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b90495e5
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b90495e5

Branch: refs/heads/LOG4J2-1748and1780-remove-ExecutorService-from-LoggerContext
Commit: b90495e50a5cd6e67aff0f3b1f628910bf2050c8
Parents: c7aaede
Author: Matt Sicker <bo...@gmail.com>
Authored: Sun Jan 15 21:09:53 2017 -0600
Committer: Matt Sicker <bo...@gmail.com>
Committed: Sun Jan 15 21:09:53 2017 -0600

----------------------------------------------------------------------
 README.md | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b90495e5/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 7913235..bdcf063 100644
--- a/README.md
+++ b/README.md
@@ -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
     }
 }
 ```