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

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: Infer hiddenness from subcommands. Created 6 years, 10 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 f1726bba72184d1122427ce9c6040bcea52344d2..0dcf088d339cfbb43c1ce0d2275cab8b57d9d81c 100644
--- a/sdk/lib/_internal/pub/lib/src/log.dart
+++ b/sdk/lib/_internal/pub/lib/src/log.dart
@@ -119,6 +119,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];
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/lish.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/solve_report.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698