PrefixPrinter constructor

PrefixPrinter(
  1. LogPrinter _realPrinter, {
  2. String? debug,
  3. String? trace,
  4. @Deprecated('[verbose] is being deprecated in favor of [trace].') dynamic verbose,
  5. String? fatal,
  6. @Deprecated('[wtf] is being deprecated in favor of [fatal].') dynamic wtf,
  7. String? info,
  8. String? warning,
  9. String? error,
})

Implementation

PrefixPrinter(
  this._realPrinter, {
  String? debug,
  String? trace,
  @Deprecated('[verbose] is being deprecated in favor of [trace].') verbose,
  String? fatal,
  @Deprecated('[wtf] is being deprecated in favor of [fatal].') wtf,
  String? info,
  String? warning,
  String? error,
}) {
  _prefixMap = {
    Level.debug: debug ?? 'DEBUG',
    Level.trace: trace ?? verbose ?? 'TRACE',
    Level.fatal: fatal ?? wtf ?? 'FATAL',
    Level.info: info ?? 'INFO',
    Level.warning: warning ?? 'WARNING',
    Level.error: error ?? 'ERROR',
  };

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