PrefixPrinter constructor
PrefixPrinter(
- LogPrinter _realPrinter, {
- String? debug,
- String? trace,
- @Deprecated('[verbose] is being deprecated in favor of [trace].') dynamic verbose,
- String? fatal,
- @Deprecated('[wtf] is being deprecated in favor of [fatal].') dynamic wtf,
- String? info,
- String? warning,
- 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)} ');
}