utils/console/printf_console library
Advanced debug console helpers with ANSI styling, log levels, and HTTP logs.
Classes
- PrintfConfig
- Global behaviour for printf helpers.
- PrintfStyle
- ANSI styling for printf output.
Enums
- PrintfLevel
- Log severity used by printf and shortcuts like printfError.
Functions
-
printf(
Object? data, {Object? mapKey, int? listIndex, String? tag, PrintfLevel level = PrintfLevel.debug, Color? foreground, Color? background, bool italic = false, bool bold = false, bool underline = false, bool invert = false, bool strike = false, bool doubleUnderline = false, bool framed = false, bool? timestamp, bool? showFile, PrintfStyle? style, String? name, int stackTraceIndex = 1}) → void -
Prints
datato the console with optional ANSI styling, tags, and metadata. -
printfBox(
String title, Object? message, {PrintfLevel level = PrintfLevel.info, String? tag}) → void -
Prints a titled box around
message. -
printfCallerLinkFromStackTrace(
String stackTraceText) → String? - Resolves a clickable caller link from a StackTrace string (for tests).
-
printfDebug(
Object? data, {String? tag, PrintfStyle? style}) → void -
printfError(
Object? data, {String? tag, Object? error, StackTrace? stackTrace, PrintfStyle? style}) → void -
printfInfo(
Object? data, {String? tag, PrintfStyle? style}) → void -
printfSeparator(
{Object object = '', int length = 20}) → String - Horizontal rule with optional label — useful to group logs.
-
printfSuccess(
Object? data, {String? tag, PrintfStyle? style}) → void -
printfTable(
Map< String, Object?> rows, {String? title, PrintfLevel level = PrintfLevel.debug, String? tag}) → void - Prints key/value rows in a aligned block.
-
printfWarn(
Object? data, {String? tag, PrintfStyle? style}) → void -
printHttpRequest(
{required String method, required String url, Map< String, Object?> ? headers, Object? body, Iterable<String> ? files, String? tag = 'HTTP'}) → void -
Logs an outgoing HTTP request without coupling to
httpordio. -
printHttpResponse(
{required String method, required String url, required int statusCode, bool? success, Object? body, Duration? duration, String? tag = 'HTTP'}) → void - Logs an HTTP response summary.