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]. |