From 6d73e8c4702f365d842354fde40635b32c96375a Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 26 May 2017 10:25:31 -0700 Subject: [PATCH] add Logger.isVerbose; rev version --- CHANGELOG.md | 3 ++- lib/cli_logging.dart | 6 ++++++ pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9b6c00b97c59..c5d12d6d0f408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog -## unreleased +## 0.1.1 - Updated to the output for indeterminate progress +- Exposed a `Logger.isVerbose` getter ## 0.1.0 diff --git a/lib/cli_logging.dart b/lib/cli_logging.dart index 66e51aaad26f7..2da62ca723ad9 100644 --- a/lib/cli_logging.dart +++ b/lib/cli_logging.dart @@ -62,6 +62,8 @@ abstract class Logger { Ansi get ansi; + bool get isVerbose; + /// Print an error message. void stderr(String message); @@ -102,6 +104,8 @@ class _StandardLogger implements Logger { ansi ??= new Ansi(Ansi.terminalSupportsAnsi); } + bool get isVerbose => false; + Progress _currentProgress; void stderr(String message) { @@ -230,6 +234,8 @@ class _VerboseLogger implements Logger { _timer = new Stopwatch()..start(); } + bool get isVerbose => true; + void stderr(String message) { flush(); _previousErr = '${ansi.red}$message${ansi.none}'; diff --git a/pubspec.yaml b/pubspec.yaml index ccd17b527a8ed..baead10dcf7e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: cli_util -version: 0.1.0 +version: 0.1.1 author: Dart Team description: A library to help in building Dart command-line apps. homepage: https://github.com/dart-lang/cli_util