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

Unified Diff: utils/pub/log.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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 | « utils/pub/io.dart ('k') | utils/pub/oauth2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/log.dart
diff --git a/utils/pub/log.dart b/utils/pub/log.dart
index ec3fee9798944e586b359b1a0ab0891f78f8d0e0..891ba7d5c18d7d13fdaa7e13273039c6a2ab44c9 100644
--- a/utils/pub/log.dart
+++ b/utils/pub/log.dart
@@ -57,7 +57,16 @@ class Entry {
}
/// Logs [message] at [Level.ERROR].
-void error(message) => write(Level.ERROR, message);
+void error(message, [error]) {
+ if (error != null) {
+ message = "$message: $error";
+ var trace = getAttachedStackTrace(error);
+ if (trace != null) {
+ message = "$message\nStackTrace: $trace";
+ }
+ }
+ write(Level.ERROR, message);
+}
/// Logs [message] at [Level.WARNING].
void warning(message) => write(Level.WARNING, message);
« no previous file with comments | « utils/pub/io.dart ('k') | utils/pub/oauth2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698