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); |