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

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

Issue 330183003: Support paths outside of "bin" for pub run. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test that root directory is served. Created 6 years, 6 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/progress.dart
diff --git a/sdk/lib/_internal/pub/lib/src/progress.dart b/sdk/lib/_internal/pub/lib/src/progress.dart
index a8e7f840fba30a754ce9c95df9b3b11ad1ebdd82..d01e95278880552a710f9a6eb680e1b51b224e55 100644
--- a/sdk/lib/_internal/pub/lib/src/progress.dart
+++ b/sdk/lib/_internal/pub/lib/src/progress.dart
@@ -32,14 +32,20 @@ class Progress {
Progress(this._message, {bool fine: false}) {
_stopwatch.start();
- // Only animate if we're writing to a TTY in human format and we're not
- // emitting FINE logging information. If we are, we'll just print the start
- // and end messages anyway.
- bool animate = !log.verbosity.isLevelVisible(log.Level.FINE) &&
- stdioType(stdout) == StdioType.TERMINAL;
- (animate || fine ? log.fine : log.message)("$_message...");
-
- if (!animate || log.json.enabled) return;
+ var level = fine ? log.Level.FINE : log.Level.MESSAGE;
+
+ // The animation is only shown when it would be meaningful to a human.
+ // That means we're writing a visible message to a TTY at normal log levels
+ // with non-JSON output.
+ if (stdioType(stdout) != StdioType.TERMINAL ||
+ !log.verbosity.isLevelVisible(level) ||
+ log.json.enabled || fine ||
+ log.verbosity.isLevelVisible(log.Level.FINE)) {
+ // Not animating, so just log the start and wait until the task is
+ // completed.
+ log.write(level, "$_message...");
+ return;
+ }
_update();
_timer = new Timer.periodic(new Duration(milliseconds: 100), (_) {

Powered by Google App Engine
This is Rietveld 408576698