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

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

Issue 138723005: Support subcommands in pub and pub help. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 months 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 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];

Powered by Google App Engine
This is Rietveld 408576698