Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Add json.Marshaler support to the Frame type. #197

Merged
merged 4 commits into from Feb 17, 2019
Merged

Add json.Marshaler support to the Frame type. #197

merged 4 commits into from Feb 17, 2019

Conversation

flimzy
Copy link
Contributor

@flimzy flimzy commented Jan 28, 2019

Fixes #196

This PR adds json.Marshaler support for the Frame type, to facilitate logging of stack traces in JSON format. The output format is equivalent to fmt.Printf("v+%"), but without newlines or tab characters.

To me, this format seems the most generally useful, but an argument could be made for outputting a JSON object instead (i.e. {"file":"...", "line": XX, "name": "..."}.).

stack.go Outdated Show resolved Hide resolved
json_test.go Outdated Show resolved Hide resolved
@flimzy
Copy link
Contributor Author

flimzy commented Jan 28, 2019

@puellanivis See updates. I left the json.Marshaler tests in tact, but maybe that can be removed as tacitly correct.

@puellanivis
Copy link

Looks good from my end.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants