[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pretty printing for formattable errors #732

Open
ghostsquad opened this issue Jul 31, 2019 · 4 comments
Open

Allow pretty printing for formattable errors #732

ghostsquad opened this issue Jul 31, 2019 · 4 comments

Comments

@ghostsquad
Copy link

Since I use pkg/errors, each error satisfies the fmt.Formatter interface and thus, every error log comes with a cause trace in the errorVerbose field.. This is great in production, but during development, (i.e. with NewDevelopmentConfig), I'd like to see the cause trace in a non-json field so that I can read it.

Right now, the formatting is that it provides several lines, separated by \n which get shoved into the errorVerbose field. Imagine if the stacktrace provided by Zap were to be shoved into a field in development mode. It would be very hard to read.

this issue forked from #650

@yqylovy
Copy link
yqylovy commented Apr 17, 2020

Same case,I change check , it's not clean code, but it works...
yqylovy@43dc4e1

@ghostsquad
Copy link
Author

@yqylovy what makes you say it's not clean code?

@yqylovy
Copy link
yqylovy commented Apr 19, 2020

When there is an errors packet, it will directly modify the stack, so different inputs will cause different behaviors.

@yqylovy
Copy link
yqylovy commented Apr 20, 2020

make it configurable.
master...yqylovy:master

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

No branches or pull requests

2 participants