PrettyPrinter constructor
PrettyPrinter({
- int stackTraceBeginIndex = 0,
- int? methodCount = 2,
- int? errorMethodCount = 8,
- int lineLength = 120,
- bool colors = true,
- bool printEmojis = true,
- bool printTime = false,
- Map<
Level, bool> excludeBox = const {}, - bool noBoxingByDefault = false,
- List<
String> excludePaths = const [], - Map<
Level, AnsiColor> ? levelColors, - Map<
Level, String> ? levelEmojis,
Implementation
PrettyPrinter({
this.stackTraceBeginIndex = 0,
this.methodCount = 2,
this.errorMethodCount = 8,
this.lineLength = 120,
this.colors = true,
this.printEmojis = true,
this.printTime = false,
this.excludeBox = const {},
this.noBoxingByDefault = false,
this.excludePaths = const [],
this.levelColors,
this.levelEmojis,
}) {
_startTime ??= DateTime.now();
var doubleDividerLine = StringBuffer();
var 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';
// Translate excludeBox map (constant if default) to includeBox map with all Level enum possibilities
_includeBox = {};
for (var l in Level.values) {
_includeBox[l] = !noBoxingByDefault;
}
excludeBox.forEach((k, v) => _includeBox[k] = !v);
}