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

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: Revise. 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..6999cb9eacb2ee9b0d849f57eafed5d2a40b011c 100644
--- a/sdk/lib/_internal/pub/lib/src/log.dart
+++ b/sdk/lib/_internal/pub/lib/src/log.dart
@@ -117,6 +117,13 @@ void write(Level level, message) {
if (_loggers.isEmpty) showNormal();
var lines = splitLines(message.toString());
+
+ // Discard a trailing newline. This is useful since StringBuffers often end
+ // up with an extra newline at the end from using [writeln].
+ if (lines.isNotEmpty && lines.last == "") {
+ lines.removeLast();
+ }
+
var entry = new Entry(level, lines);
var logFn = _loggers[level];

Powered by Google App Engine
This is Rietveld 408576698