TextFormatter constructor

TextFormatter(
  1. FormatHandler format, {
  2. LevelFormatter<String> formatLevel = _formatLevel,
  3. TimestampFormatter<String> formatTimestamp = _formatTimestamp,
})

Creates a new TextFormatter instance with format callback used to composite the final logging message.

Optional formatLevel, formatTimestamp callbacks may be also provided used to encode Level, record timestamp and bound Field set (if any).

format callback takes already encoded level, time and field sets as well as logger name and logged message.

Implementation

TextFormatter(
  this.format, {
  this.formatLevel = _formatLevel,
  this.formatTimestamp = _formatTimestamp,
}) {
  _init();
}