Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

add Logger.isVerbose; rev version #20

Merged
merged 1 commit into from
May 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## unreleased
## 0.1.1

- Updated to the output for indeterminate progress
- Exposed a `Logger.isVerbose` getter

## 0.1.0

Expand Down
6 changes: 6 additions & 0 deletions lib/cli_logging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ abstract class Logger {

Ansi get ansi;

bool get isVerbose;

/// Print an error message.
void stderr(String message);

Expand Down Expand Up @@ -102,6 +104,8 @@ class _StandardLogger implements Logger {
ansi ??= new Ansi(Ansi.terminalSupportsAnsi);
}

bool get isVerbose => false;

Progress _currentProgress;

void stderr(String message) {
Expand Down Expand Up @@ -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}';
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cli_util
version: 0.1.0
version: 0.1.1
author: Dart Team <[email protected]>
description: A library to help in building Dart command-line apps.
homepage: https://github.com/dart-lang/cli_util
Expand Down