Logger class

A basic Logger which wraps stdio and applies various styles.

Constructors

Logger({LogTheme theme = const LogTheme(), Level level = Level.info, ProgressOptions progressOptions = const ProgressOptions()})
A basic Logger which wraps stdio and applies various styles.

Properties

hashCode int
The hash code for this object.
no setterinherited
level Level
The current log level for this logger.
getter/setter pair
progressOptions ProgressOptions
The progress options for the logger instance.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme LogTheme
The current theme for this logger.
final

Methods

alert(String? message, {LogStyle? style}) → void
Writes alert message to stdout.
chooseAny<T extends Object?>(String? message, {required List<T> choices, List<T>? defaultValues, String display(T choice)?}) List<T>
Prompts user with message to choose zero or more values from the provided choices.
chooseOne<T extends Object?>(String? message, {required List<T> choices, T? defaultValue, String display(T choice)?}) → T
Prompts user with message to choose one value from the provided choices.
confirm(String? message, {bool defaultValue = false}) bool
Prompts user with a yes/no question.
delayed(String? message) → void
Writes delayed message to stdout.
detail(String? message, {LogStyle? style}) → void
Writes detail message to stdout.
err(String? message, {LogStyle? style}) → void
Writes error message to stderr.
flush([void print(String?)?]) → void
Flushes internal message queue.
info(String? message, {LogStyle? style}) → void
Writes info message to stdout.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
progress(String message, {ProgressOptions? options}) Progress
Writes progress message to stdout. Optionally provide options to override the current ProgressOptions for the generated Progress.
prompt(String? message, {Object? defaultValue, bool hidden = false}) String
Prompts user and returns response. Provide a default value via defaultValue. Set hidden to true if you want to hide user input for sensitive info.
promptAny(String? message, {String separator = ','}) List<String>
Prompts user for a free-form list of responses.
success(String? message, {LogStyle? style}) → void
Writes success message to stdout.
toString() String
A string representation of this object.
inherited
warn(String? message, {String tag = 'WARN', LogStyle? style}) → void
Writes warning message to stderr.
write(String? message) → void
Write message via stdout.write.

Operators

operator ==(Object other) bool
The equality operator.
inherited