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

Unified Diff: lib/src/command/serve.dart

Issue 1267023002: Collapse successful GET messages together. (Closed) Base URL: https://github.com/dart-lang/pub.git@master
Patch Set: Show a special collapsed message instead of the first one. Created 5 years, 4 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
« no previous file with comments | « no previous file | lib/src/log.dart » ('j') | lib/src/log.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/command/serve.dart
diff --git a/lib/src/command/serve.dart b/lib/src/command/serve.dart
index e43a9fc2bfa8f6c67b382bf74165e3f3f0d242f6..384832875ed22148eb9d7dbbd34d8b947113cc35 100644
--- a/lib/src/command/serve.dart
+++ b/lib/src/command/serve.dart
@@ -148,18 +148,17 @@ class ServeCommand extends BarbackCommand {
}
// Add two characters to account for "[" and "]".
- var prefix = log.gray(
+ var directory = log.gray(
padRight("[${server.rootDirectory}]", directoryLength + 2));
server.results.listen((result) {
- var buffer = new StringBuffer();
- buffer.write("$prefix ");
-
if (result.isSuccess) {
- buffer.write(
- "${log.green('GET')} ${result.url.path} $_arrow ${result.id}");
+ var prefix = "$directory ${log.green('GET')}";
+ log.collapsible("$prefix ${result.url.path} $_arrow ${result.id}",
+ "$prefix Served ## assets.");
} else {
- buffer.write("${log.red('GET')} ${result.url.path} $_arrow");
+ var buffer = new StringBuffer();
+ buffer.write("$directory ${log.red('GET')} ${result.url.path} $_arrow");
var error = result.error.toString();
if (error.contains("\n")) {
@@ -167,9 +166,9 @@ class ServeCommand extends BarbackCommand {
} else {
buffer.write(" $error");
}
- }
- log.message(buffer);
+ log.error(buffer);
+ }
}, onError: _fatalError);
log.message("Serving ${entrypoint.root.name} "
« no previous file with comments | « no previous file | lib/src/log.dart » ('j') | lib/src/log.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698