Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: pkg/logging/README.md

Issue 420553007: updated logging package to accept functions or other non-string objects when logging (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: "bump version and add example for logging with a closure" Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/logging/lib/logging.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/logging/README.md
diff --git a/pkg/logging/README.md b/pkg/logging/README.md
index 9d6c97815a78f835054978ad179d77b0052caff9..f4781a7aecd36015edacbc5f10f25d051be49ae7 100644
--- a/pkg/logging/README.md
+++ b/pkg/logging/README.md
@@ -39,4 +39,11 @@ var future = doSomethingAsync().then((result) {
}).catchError((e, stackTrace) => log.severe('Oh noes!', e, stackTrace));
```
+When logging more complex messages, you can pass a closure instead
+that will be evaluated only if the message is actually logged:
+
+```dart
+ log.fine(() => [1, 2, 3, 4, 5].map((e) => e * 4).join("-"));
+```
+
See the [Logger] class for the different logging methods.
« no previous file with comments | « no previous file | pkg/logging/lib/logging.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698