stack_trace_codec

Build Status Pub Package Version Latest Dartdocs

Serialize stack traces from the stack_trace package.

Disclaimer: This is not an official Google or Dart project.

Installation

Add stack_trace_codec in your pubspec file:

dependencies:
  stack_trace_codec: ^0.1.0

And that's it! See usage for details.

Usage

Currently, a single codec, JsonTraceCodec, is available:

import 'dart:convert';

import 'package:stack_trace/stack_trace.dart';
import 'package:stack_trace_codec/stack_trace_codec.dart';

void logJson(String json) { /* ... */ }

// See package:stack_trace for details on converting from StackTrace --> Trace.
void logStackTrace(Trace trace) {
  logJson(JSON.encode(const JsonTraceCodec().encode(trace)));
}

Contributing

We welcome a diverse set of contributions, including, but not limited to:

For the stability of the API and existing users, consider opening an issue first before implementing a large new feature or breaking an API. For smaller changes (like documentation, minor bug fixes), just send a pull request.

Testing

All pull requests are validated against travis, and must pass.

Ensure code passes all our analyzer checks:

$ dartanalyzer .

Ensure all code is formatted with the latest dev-channel SDK.

$ dartfmt -w .

Run all of our unit tests:

$ pub run test

Libraries

stack_trace_codec