PrefixPrinter constructor

PrefixPrinter(
  1. LogPrinter _realPrinter, {
  2. dynamic debug,
  3. dynamic verbose,
  4. dynamic wtf,
  5. dynamic info,
  6. dynamic warning,
  7. dynamic error,
})

Implementation

PrefixPrinter(this._realPrinter,
    {debug, verbose, wtf, info, warning, error}) {
  _prefixMap = {
    Level.debug: debug ?? 'DEBUG',
    Level.verbose: verbose ?? 'VERBOSE',
    Level.wtf: wtf ?? 'WTF',
    Level.info: info ?? 'INFO',
    Level.warning: warning ?? 'WARNING',
    Level.error: error ?? 'ERROR',
    Level.success: 'SUCCESS',
  };

  var len = _longestPrefixLength();
  _prefixMap.forEach((k, v) => _prefixMap[k] = '${v.padLeft(len)} ');
}