File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ class PrettyPrinter extends LogPrinter {
6363
6464 static DateTime ? _startTime;
6565
66+ /// The index which to begin the stack trace at
67+ ///
68+ /// This can be useful if, for instance, Logger is wrapped in another class and
69+ /// you wish to remove these wrapped calls from stack trace
70+ final int stackTraceBeginIndex;
6671 final int methodCount;
6772 final int errorMethodCount;
6873 final int lineLength;
@@ -75,6 +80,7 @@ class PrettyPrinter extends LogPrinter {
7580 String _bottomBorder = '' ;
7681
7782 PrettyPrinter ({
83+ this .stackTraceBeginIndex = 0 ,
7884 this .methodCount = 2 ,
7985 this .errorMethodCount = 8 ,
8086 this .lineLength = 120 ,
@@ -127,6 +133,9 @@ class PrettyPrinter extends LogPrinter {
127133
128134 String ? formatStackTrace (StackTrace ? stackTrace, int methodCount) {
129135 var lines = stackTrace.toString ().split ('\n ' );
136+ if (stackTraceBeginIndex > 0 ) {
137+ lines = lines.sublist (stackTraceBeginIndex);
138+ }
130139 var formatted = < String > [];
131140 var count = 0 ;
132141 for (var line in lines) {
You can’t perform that action at this time.
0 commit comments