mason_logger library

A reusable Dart logger used by the Mason CLI.

Get started at https://github.com/felangel/mason 🧱

Classes

AnsiCode
Standard ANSI escape code for customizing terminal text output.
AnsiCodeType
The type of code represented by AnsiCode.
ExitCode
Exit code constants.
Logger
A basic Logger which wraps stdio and applies various styles.
LogTheme
A theme object which contains styles for all log message types.
Progress
A class that can be used to display progress information to the user.
ProgressAnimation
An object which contains configuration for the animation of a Progress instance.
ProgressOptions
An object containing configuration for a Progress instance.

Enums

Level
Indicates the desired logging level.

Constants

backgroundBlack → const AnsiCode
backgroundBlue → const AnsiCode
backgroundColors → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.background.
backgroundCyan → const AnsiCode
backgroundDarkGray → const AnsiCode
backgroundDefault → const AnsiCode
backgroundGreen → const AnsiCode
backgroundLightBlue → const AnsiCode
backgroundLightCyan → const AnsiCode
backgroundLightGray → const AnsiCode
backgroundLightGreen → const AnsiCode
backgroundLightMagenta → const AnsiCode
backgroundLightRed → const AnsiCode
backgroundLightYellow → const AnsiCode
backgroundMagenta → const AnsiCode
backgroundRed → const AnsiCode
backgroundWhite → const AnsiCode
backgroundYellow → const AnsiCode
black → const AnsiCode
blue → const AnsiCode
cyan → const AnsiCode
darkGray → const AnsiCode
defaultForeground → const AnsiCode
foregroundColors → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.foreground.
green → const AnsiCode
lightBlue → const AnsiCode
lightCyan → const AnsiCode
lightGray → const AnsiCode
lightGreen → const AnsiCode
lightMagenta → const AnsiCode
lightRed → const AnsiCode
lightYellow → const AnsiCode
magenta → const AnsiCode
red → const AnsiCode
resetAll → const AnsiCode
resetBold → const AnsiCode
resetDim → const AnsiCode
resetItalic → const AnsiCode
resetReverse → const AnsiCode
resetUnderlined → const AnsiCode
styleBold → const AnsiCode
styleDim → const AnsiCode
styleItalic → const AnsiCode
styleReverse → const AnsiCode
styles → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.style.
styleUnderlined → const AnsiCode
white → const AnsiCode
yellow → const AnsiCode

Properties

ansiOutputEnabled → bool
Whether formatted ANSI output is enabled for wrapWith and AnsiCode.wrap.
no setter

Functions

Wraps uri with an escape sequence so it's recognized as a hyperlink. An optional message can be used in place of the uri. If no message is provided, the text content will be the full uri.
overrideAnsiOutput<T>(bool enableAnsiOutput, T body()) → T
Allows overriding ansiOutputEnabled to enableAnsiOutput for the code run within body.

Typedefs

LogStyle = String? Function(String? message)
Type definition for a function which accepts a log message and returns a styled version of that message.