Closed defuncart closed 3 years ago
If I understand it correctly this is the counterpart of methodCount
?
I also need to commend you on the excellent commits, that alone makes me want to merge it. ;)
@haarts stackTraceBeginIndex
is the index to begin the stack trace at, while methodCount
is the number of methods that should be shown from the stack trace.
So, for instance
class MyLogger {
final _logger = Logger(
printer: PrettyPrinter(
stackTraceBeginIndex: 1,
),
);
void debug(dynamic obj) => _logger.d(obj);
}
void main(){
MyLogger().debug('Hello, World!');
}
In the console something like
main.dart:2 MyLogger().debug('Hello, World!');
would be printed out. Without stackTraceBeginIndex
set to 1, something along the lines of
my_logger.dart:7 void debug(dynamic obj) => _logger.d(obj);
main.dart:2 MyLogger().debug('Hello, World!');
would be printed as the stack trace.
Adds the setting
stackTraceBeginIndex
(the index which to begin the stack trace at) toPrettyPrinter
. This can be useful if, for instance, Logger is wrapped in another class and you wish to remove these wrapped calls from stack trace.Looking forward to your feedback :)