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 bbbcb3c95f5bcf6250c0bb6a50276778c4303e1c..3ee580b45e02a42d8a0af2229b4a215403d4c343 100644 |
--- a/sdk/lib/_internal/pub/lib/src/log.dart |
+++ b/sdk/lib/_internal/pub/lib/src/log.dart |
@@ -117,6 +117,14 @@ void write(Level level, message) { |
if (_loggers.isEmpty) showNormal(); |
var lines = splitLines(message.toString()); |
+ |
+ // If the object being logged is a StringBuffer, it often has a trailing |
+ // newline because it's typical to write to it using [writeln]. That's |
+ // redundant with the newline implied by the log entry itself, so remove it. |
+ if (message is StringBuffer && lines.last == "") { |
+ lines.removeLast(); |
+ } |
nweiz
2014/01/31 21:42:06
I like the effect of this, but I don't like the lo
Bob Nystrom
2014/02/01 01:49:32
Done. I tried that at first but it broke the pub l
|
+ |
var entry = new Entry(level, lines); |
var logFn = _loggers[level]; |