directPrint method

void directPrint(
  1. dynamic contents, {
  2. void logger(
    1. String contents
    )?,
})

Prints the contents to the console.

defaults to Stdout.writeln.

Implementation

void directPrint(dynamic contents, {void Function(String contents)? logger}) {
  logger ??= stdout.writeln;
  final buf = convert(contents);
  final lines = LineSplitter().convert(buf.toString());
  for (var l in lines) {
    logger!(l);
  }
}