mason_logger
0.3.6, released 2 months ago by brickhub.dev
A lightweight CLI logger with prompts, progress, and custom styling.
What it does
Provides a Logger class for stdout logging, user prompts, progress bars, and hyperlink support. It is used by the Mason CLI and can be used in any Dart console app.
AI-written summary of version 0.3.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building command‑line tools that need user interaction
- Adding structured logs to a Dart CLI
- Creating progress indicators for async tasks
Skip it when
- Developing Flutter UI widgets
- Needing a logging framework for mobile or web apps
Strengths
- Simple API, no build_runner or codegen
- Customizable styles and themes
- Built‑in prompt, choice, and progress utilities
Weaknesses
- Only works in terminal environments
- No async stream or file logging support
- Limited to Dart CLI, not Flutter
Setup
- Kind
- FFI (native library)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add dependency to pubspec and import package:mason_logger/mason_logger.dart
import 'package:mason_logger/mason_logger.dart';
final logger = Logger();
logger.info('Hello, world!');
final choice = logger.chooseOne('Pick a color', choices: ['red','green']);
print('You chose $choice');Alternatives
Packages that do the same job and could replace mason_logger.
Works with
Packages commonly used together with mason_logger: ones it builds on, ones built on it, and its own family.
- iomason_logger depends on itUtilities for the Dart VM Runtime including ANSI colors, file copying, and exit code values.
- ffimason_logger depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- win32mason_logger depends on itCall common Windows APIs and COM objects directly from Dart using FFI.
- mason_cliSame familyCLI tool to create and consume reusable template bricks for code generation.
- mason_apiSame familyDart API client for Mason CLI
- masonBuilt on mason_loggerDart template generator for quick file creation
- cli_completionBuilt on mason_loggerCompletion functionality for Dart Command-Line Interfaces built using CommandRunner.
- very_good_cliBuilt on mason_loggerCLI for creating and managing Dart/Flutter projects