- fix: only animate progress on terminals
- fix: improve clear line mechanism for Progress API
-
BREAKING feat: add generic support to
chooseOne
andchooseAny
enum Shape { square, circle, triangle} void main() { final logger = Logger(); final shape = logger.chooseOne<Shape>( 'What is your favorite shape?', choices: Shape.values, display: (shape) => '${shape.name}', ); logger.info('You chose: $shape'); final shapes = logger.chooseAny<Shape>( 'Or did you want to choose multiples?', choices: Shape.values, defaultValues: [shape], display: (shape) => '${shape.name}', ); logger.info('You chose: $shapes'); }
-
feat: add
ProgressOptions
APIimport 'package:mason_logger/mason_logger.dart'; Future<void> main() async { // 1. ✨ Create a custom ProgressOptions. const progressOptions = ProgressOptions( animation: ProgressAnimation( frames: ['🌑', '🌒', '🌓', '🌔', '🌕', '🌖', '🌗', '🌘'], ), ); // 2. 💉 Inject `progressOptions` into your Logger. final logger = Logger(progressOptions: progressOptions); // 3. 🤤 Admire your custom progress animation. final progress = logger.progress('Calculating'); await Future.delayed(const Duration(seconds: 3)); progress.complete('Done!'); }
-
feat: add
link
APIfinal logger = Logger(); final repoLink = link( message: 'GitHub Repository', uri: Uri.parse('https://github.com/felangel/mason'), ); logger.info('To learn more, visit the $repoLink.');
- feat: render milliseconds on progress duration
- refactor(deps): remove
package:meta
- refactor: use
IOOverrides
- refactor(deps): remove
pkg:universal_io
- docs: fix typo in
README
snippet
- BREAKING: support log levels (default
Level
isLevel.info
) - BREAKING: mark
Progress()
as@internal
- BREAKING:
alert
writes tostderr
instead ofstdout
- BREAKING:
Progress.fail(...)
writes tostdout
instead ofstderr
- BREAKING: remove deprecated
Progress.call(...)
(useProgress.complete
instead).
- feat:
Progress.update
final progress = logger.progress('Calculating'); await Future<void>.delayed(const Duration(milliseconds: 500)); progress.update('Halfway!'); await Future<void>.delayed(const Duration(milliseconds: 500)); progress.complete('Done!');
- fix: correct J and K key mappings
- fix:
chooseOne
API windows compatibility - feat:
chooseAny
/// Ask user to choose zero or more options. final desserts = logger.chooseAny( 'Which desserts do you like?', choices: ['🍦', '🍪', '🍩'], );
- fix: write errors and warnings to
stderr
Logger().err(...)
Logger().warn(...)
Logger().progress(...).fail(...)
-
feat:
chooseOne
APIfinal favoriteColor = logger.chooseOne( 'What is your favorite color?', choices: ['red', 'green', 'blue'], defaultValue: 'blue', );
- feat:
progress
API enhancementsfinal progress = Logger().progress('calculating'); try { await _performCalculation(); // Complete progress successfully. progress.complete(); } catch (error, stackTrace) { // Terminate progress unsuccessfully. progress.fail(); }
- fix: single line prompts are overwritten
- when using
confirm
andprompt
- when using
- fix: multiline prompts are outputting twice
- when using
confirm
andprompt
- when using
- feat: add
write
- feat: add
hidden
flag toprompt
- chore: upgrade to Dart 2.16
- fix:
progress
string truncation - feat: add
confirm
- feat: add
defaultValue
toprompt
- feat: improve
progress
time style - docs: update example and
README
- feat: add
tag
towarn
call
- test: 100% test coverage
- docs: README updates to include usage
- docs: include example
Dev Release
- chore: initial package (🚧 under construction 🚧)