| OLD | NEW |
| 1 This library provides the ability to parse, inspect, and manipulate stack traces | 1 This library provides the ability to parse, inspect, and manipulate stack traces |
| 2 produced by the underlying Dart implementation. It also provides functions to | 2 produced by the underlying Dart implementation. It also provides functions to |
| 3 produce string representations of stack traces in a more readable format than | 3 produce string representations of stack traces in a more readable format than |
| 4 the native [StackTrace] implementation. | 4 the native [StackTrace] implementation. |
| 5 | 5 |
| 6 `Trace`s can be parsed from native [StackTrace]s using `Trace.from`, or captured | 6 `Trace`s can be parsed from native [StackTrace]s using `Trace.from`, or captured |
| 7 using `Trace.current`. Native [StackTrace]s can also be directly converted to | 7 using `Trace.current`. Native [StackTrace]s can also be directly converted to |
| 8 human-readable strings using `Trace.format`. | 8 human-readable strings using `Trace.format`. |
| 9 | 9 |
| 10 [StackTrace]: http://api.dartlang.org/docs/releases/latest/dart_core/StackTrace.
html | 10 [StackTrace]: http://api.dartlang.org/docs/releases/latest/dart_core/StackTrace.
html |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 together multiple stack frames from the Dart core libraries, so that only the | 47 together multiple stack frames from the Dart core libraries, so that only the |
| 48 core library method that was directly called from user code is visible. For | 48 core library method that was directly called from user code is visible. For |
| 49 example: | 49 example: |
| 50 | 50 |
| 51 dart:core Object.noSuchMethod | 51 dart:core Object.noSuchMethod |
| 52 pkg/stack_trace/lib/src/trace.dart 47:21 Trace.terse.<fn> | 52 pkg/stack_trace/lib/src/trace.dart 47:21 Trace.terse.<fn> |
| 53 dart:core List.reduce | 53 dart:core List.reduce |
| 54 pkg/stack_trace/lib/src/trace.dart 40:35 Trace.terse | 54 pkg/stack_trace/lib/src/trace.dart 40:35 Trace.terse |
| 55 pkg/stack_trace/lib/stack_trace.dart 24:28 format | 55 pkg/stack_trace/lib/stack_trace.dart 24:28 format |
| 56 test.dart 21:29 main.<fn> | 56 test.dart 21:29 main.<fn> |
| 57 dart:async Timer.Timer.<fn> | |
| 58 | 57 |
| 59 ## Stack Chains | 58 ## Stack Chains |
| 60 | 59 |
| 61 This library also provides the ability to capture "stack chains" with the | 60 This library also provides the ability to capture "stack chains" with the |
| 62 `Chain` class. When writing asynchronous code, a single stack trace isn't very | 61 `Chain` class. When writing asynchronous code, a single stack trace isn't very |
| 63 useful, since the call stack is unwound every time something async happens. A | 62 useful, since the call stack is unwound every time something async happens. A |
| 64 stack chain tracks stack traces through asynchronous calls, so that you can see | 63 stack chain tracks stack traces through asynchronous calls, so that you can see |
| 65 the full path from `main` down to the error. | 64 the full path from `main` down to the error. |
| 66 | 65 |
| 67 To use stack chains, just wrap the code that you want to track in | 66 To use stack chains, just wrap the code that you want to track in |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 186 |
| 188 That's a lot of text! If you look closely, though, you can see that `main` is | 187 That's a lot of text! If you look closely, though, you can see that `main` is |
| 189 listed in the first trace in the chain. | 188 listed in the first trace in the chain. |
| 190 | 189 |
| 191 Thankfully, you can call `Chain.terse` just like `Trace.terse` to get rid of all | 190 Thankfully, you can call `Chain.terse` just like `Trace.terse` to get rid of all |
| 192 the frames you don't care about. The terse version of the stack chain above is | 191 the frames you don't care about. The terse version of the stack chain above is |
| 193 this: | 192 this: |
| 194 | 193 |
| 195 test.dart 17:3 runAsync | 194 test.dart 17:3 runAsync |
| 196 test.dart 13:28 scheduleAsync.<fn> | 195 test.dart 13:28 scheduleAsync.<fn> |
| 197 dart:isolate _RawReceivePortImpl._handleMessage | |
| 198 ===== asynchronous gap =========================== | 196 ===== asynchronous gap =========================== |
| 199 dart:async _Future.then | 197 dart:async _Future.then |
| 200 test.dart 13:12 scheduleAsync | 198 test.dart 13:12 scheduleAsync |
| 201 test.dart 7:18 main.<fn> | 199 test.dart 7:18 main.<fn> |
| 202 package:stack_trace/src/chain.dart 93:20 Chain.capture | 200 package:stack_trace Chain.capture |
| 203 test.dart 6:16 main | 201 test.dart 6:16 main |
| 204 dart:isolate _RawReceivePortImpl._handleMessage | |
| 205 | 202 |
| 206 That's a lot easier to understand! | 203 That's a lot easier to understand! |
| 207 | 204 |
| 208 [Zone]: https://api.dartlang.org/apidocs/channels/stable/#dart-async.Zone | 205 [Zone]: https://api.dartlang.org/apidocs/channels/stable/#dart-async.Zone |
| OLD | NEW |