stacktrace_impl 2.0.1
stacktrace_impl: ^2.0.1 copied to clipboard

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));


1
likes
110
pub points
80%
popularity

Allows you to instantiate a StackTrace and provides logging control.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

bsutton@noojee.com.au

License

MIT (LICENSE)

Dependencies

path

More

Packages that depend on stacktrace_impl