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

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: Code review changes Created 6 years 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 | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/lib/src/source/git.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..14627122e29b4eb1d3faec6ed8d03cb045d6124b 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;
}
write(Level.ERROR, message);
+ if (trace != null) write(Level.FINE, new Chain.forTrace(trace));
}
/// Logs [message] at [Level.WARNING].
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/lib/src/source/git.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698