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

Unified Diff: sdk/lib/_internal/pub/lib/src/log.dart

Issue 745153002: Make pub's binstubs resilient to changes in snapshot format. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
Index: sdk/lib/_internal/pub/lib/src/log.dart
diff --git a/sdk/lib/_internal/pub/lib/src/log.dart b/sdk/lib/_internal/pub/lib/src/log.dart
index edc7fe0d75f7b422d3cdd9cfd9dcef9f7338d291..2049ad706420988db25f9e3d9c14b07ebd4287d3 100644
--- a/sdk/lib/_internal/pub/lib/src/log.dart
+++ b/sdk/lib/_internal/pub/lib/src/log.dart
@@ -182,16 +182,16 @@ class Entry {
}
/// Logs [message] at [Level.ERROR].
-void error(message, [error]) {
+///
+/// If [error] is passed, it's appended to [message]. If [trace] is passed, it's
+/// printed at log level fine.
+void error(message, [error, StackTrace trace]) {
if (error != null) {
message = "$message: $error";
- var trace;
- if (error is Error) trace = error.stackTrace;
- if (trace != null) {
- message = "$message\nStackTrace: $trace";
- }
+ if (error is Error && trace != null) trace = error.stackTrace;
Bob Nystrom 2014/11/21 19:13:41 ==
nweiz 2014/11/22 02:32:56 Done.
}
write(Level.ERROR, message);
+ if (trace != null) write(Level.FINE, new Chain.forTrace(trace));
}
/// Logs [message] at [Level.WARNING].

Powered by Google App Engine
This is Rietveld 408576698