PrettyLogPrinter constructor
PrettyLogPrinter({
- int stackTraceBeginIndex = 0,
- int? methodCount = 0,
- int? errorMethodCount = 10,
- int lineLength = 100,
- bool colors = true,
- bool printEmojis = true,
- DateTimeFormatter dateTimeFormat = DateTimeFormat.dateAndTime,
- Map<
Level, bool> excludeBox = const {}, - bool noBoxingByDefault = false,
- List<
String> excludePaths = const [], - Map<
Level, AnsiColor> ? levelColors, - 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);
}