CommandLogger class

Logger that logs using the provided cli.Logger. This interface is created to make it easier to follow the UX guidelines, as outlined in this issue: https://github.com/serverpod/serverpod_cloud/issues/371

Guiding principles

Clear and Concise Communication

Use precise language: messages should be brief but informative, guiding users without overwhelming them.

Consistency in Interactions

Standardize the phrasing, formatting, and style of commands, errors, and responses. Use predictable patterns that help users form mental models.

Thematic πŸš€ , Yet Professional

In general use space-themed metaphors sparingly to keep the interface professional, but they can be used where it's suitable. Align messaging with the Serverpod space theme in a way that conveys progress and exploration. Avoid overly playful language but embrace an aspirational, empowering tone (e.g., "βœ… Booster liftoff: Upload successful!" for build status instead of β€œWe’re blasting off!”). Integrate subtle rocket/space motifs in ASCII art or feedback visuals, where appropriate, without distracting from usability.

Actionable Feedback

Every error or success message should offer guidance or a pathway forward (e.g., suggest corrections or next commands).

Graceful Handling of Errors

Acknowledge the user’s intent with empathy. Avoid making them feel at fault or blaming them.

Messaging guidelines

The language used should always be written in an objective tone and avoid addressing the user with "you" or refer to the system as "we" (e.g. "The project was deployed" instead of "Your project was deployed").

Constructors

CommandLogger.new(Logger logger, {GlobalConfiguration? configuration})
CommandLogger.create([LogLevel logLevel = cli.LogLevel.info])
factory

Properties

configuration ↔ GlobalConfiguration?
getter/setter pair
hashCode β†’ int
The hash code for this object.
no setterinherited
logLevel ↔ LogLevel
getter/setter pair
runtimeType β†’ Type
A representation of the runtime type of the object.
no setterinherited
wrapTextColumn β†’ int?
no setter

Methods

box(String message, {bool newParagraph = false, LogLevel level = cli.LogLevel.info}) β†’ void
//////////////////// Box Messages Guidelines
confirm(String message, {bool? defaultValue}) β†’ Future<bool>
//////////////////// Confirmation Messages Guidelines
debug(String message, {LogType type = cli.TextLogType.normal, bool newParagraph = false}) β†’ void
Debug Messages Guidelines
error(String message, {Exception? exception, String? hint, bool newParagraph = false, StackTrace? stackTrace, bool forcePrintStackTrace = false}) β†’ void
Error Messages Guidelines
flush() β†’ Future<void>
info(String message, {bool newParagraph = false}) β†’ void
Information Messages Guidelines
init(String message, {LogLevel level = cli.LogLevel.info, bool newParagraph = false}) β†’ void
Init Messages Guidelines
input(String message, {String? defaultValue}) β†’ Future<String>
Input Request Guidelines
line(String line, {LogLevel level = cli.LogLevel.info}) β†’ void
Line Output Guidelines
list(Iterable<String> items, {String? title, LogLevel level = cli.LogLevel.info, bool newParagraph = false}) β†’ void
List Guidelines
log(String message, {required LogLevel level, bool newParagraph = false, LogType type = cli.TextLogType.normal}) β†’ void
Log Messages Guidelines
noSuchMethod(Invocation invocation) β†’ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
progress(String message, Future<bool> runner(), {bool newParagraph = false}) β†’ Future<bool>
Progress Messages Guidelines
raw(String content, {AnsiStyle? style, LogLevel logLevel = cli.LogLevel.info}) β†’ void
Raw Messages Guidelines
success(String message, {LogLevel level = cli.LogLevel.info, bool trailingRocket = false, bool newParagraph = false, String? followUp}) β†’ void
Success Messages Guidelines
terminalCommand(String command, {String? message, LogLevel level = cli.LogLevel.info, bool newParagraph = false}) β†’ void
Terminal Command Messages Guidelines
toString() β†’ String
A string representation of this object.
inherited
warning(String message, {bool newParagraph = false, String? hint}) β†’ void
Warning Messages Guidelines

Operators

operator ==(Object other) β†’ bool
The equality operator.
inherited