Chromium Code Reviews| 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 0b93b3f3df26cee40c5b536b0bb67f05d22ec3c5..178ebd7376824461e52cda4460ce8c003c5ab4a3 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/log.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/log.dart |
| @@ -225,6 +225,11 @@ void dumpTranscript() { |
| /// returned by [callback] completes. If anything else is logged during this |
| /// (include another call to [progress]) that cancels the progress. |
| Future progress(String message, Future callback()) { |
| + // If messages are not output, don't output progress either. |
| + if (_loggers[Level.MESSAGE] == null) { |
| + return callback(); |
|
nweiz
2014/05/29 19:30:09
Nit: This looks like it can fit on the previous li
Bob Nystrom
2014/05/30 18:17:47
Done.
|
| + } |
| + |
| _stopProgress(); |
| _progress = new Progress(message); |
| return callback().whenComplete(() { |
| @@ -333,6 +338,16 @@ void showAll() { |
| _loggers[Level.FINE] = _logToStderrWithLabel; |
| } |
| +/// Sets the verbosity to "error", which only logs errors. |
| +void showError() { |
| + _loggers[Level.ERROR] = _logToStderrWithLabel; |
| + _loggers[Level.WARNING] = null; |
| + _loggers[Level.MESSAGE] = null; |
| + _loggers[Level.IO] = null; |
| + _loggers[Level.SOLVER] = null; |
| + _loggers[Level.FINE] = null; |
| +} |
| + |
| /// Log function that prints the message to stdout. |
| void _logToStdout(Entry entry) { |
| _logToStream(stdout, entry, showLabel: false); |