PrettyLogPrinter constructor

PrettyLogPrinter({
  1. int stackTraceBeginIndex = 0,
  2. int? methodCount = 0,
  3. int? errorMethodCount = 10,
  4. int lineLength = 100,
  5. bool colors = true,
  6. bool printEmojis = true,
  7. DateTimeFormatter dateTimeFormat = DateTimeFormat.dateAndTime,
  8. Map<Level, bool> excludeBox = const {},
  9. bool noBoxingByDefault = false,
  10. List<String> excludePaths = const [],
  11. Map<Level, AnsiColor>? levelColors,
  12. Map<Level, String>? levelEmojis,
})

Implementation

PrettyLogPrinter({
  this.stackTraceBeginIndex = 0,
  this.methodCount = 0,
  this.errorMethodCount = 10,
  this.lineLength = 100,
  this.colors = true,
  this.printEmojis = true,
  this.dateTimeFormat = DateTimeFormat.dateAndTime,
  this.excludeBox = const {},
  this.noBoxingByDefault = false,
  this.excludePaths = const [],
  this.levelColors,
  this.levelEmojis,
}) {
  startTime ??= DateTime.now();

  final doubleDividerLine = StringBuffer();
  final singleDividerLine = StringBuffer();
  for (var i = 0; i < lineLength - 1; i++) {
    doubleDividerLine.write(doubleDivider);
    singleDividerLine.write(singleDivider);
  }

  _topBorder = '$topLeftCorner$doubleDividerLine';
  _middleBorder = '$middleCorner$singleDividerLine';
  _bottomBorder = '$bottomLeftCorner$doubleDividerLine';

  for (final level in Level.values) {
    _includeBox[level] = !noBoxingByDefault;
  }
  excludeBox.forEach((key, value) => _includeBox[key] = !value);
}