stacktrace_impl 2.3.0 copy "stacktrace_impl: ^2.3.0" to clipboard
stacktrace_impl: ^2.3.0 copied to clipboard

discontinuedreplaced by: stack_trace

Allows you to instantiate a StackTrace and provides logging control.

Provides a implementation of the Dart StrackTrace.

StacktraceImpl allows you to allocate a stack trace from within your own code.

    /// create a stack trace from the current line.
    var stack = StackTraceImpl(skipFrames: 1);

    for (var frame in stack.frames) {
        print('${frame.sourceFile} ${frame.lineNo} ${frame.column}');
    }

    runZoned(() {
      print('hi');
    }, onError: (Object e, StackTrace st) {

      /// Create a StackTraceImpl from a StackTrace
      var sti = StackTraceImpl.fromStackTrace(st);

      for (var frame in sti.frames) {
        print('${frame.sourceFile} ${frame.lineNo} ${frame.column}');
      }
    });


    /// output a formatted stack trace
    /// Show the path to each source file.
    /// skip the first frame.
    /// Only show the next 10 frames.
    print(stack.formatStackTrace(showPath: true, methodCount: 10, skipFrames:1));


2
likes
150
pub points
60%
popularity

Publisher

verified publisheronepub.dev

Allows you to instantiate a StackTrace and provides logging control.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

path

More

Packages that depend on stacktrace_impl