verbose function

void verbose(
  1. String callback()
)

If Settings.isVerbose is true then this method will call callback to get a String which will be logged to the console or the log file set via the verbose command line option.

This method is more efficient than calling Settings.verbose as it will only build the string if verbose is enabled.

verbose(() => 'Log the users name $user');

Implementation

void verbose(String Function() callback) {
  if (Settings().isVerbose) {
    final frame = Trace.current().frames[1];
    core.Settings().verbose(callback(), frame: frame);
  }
}