Open ghostsquad opened 4 years ago
Same case,I change check
, it's not clean code, but it works...
https://github.com/yqylovy/zap/commit/43dc4e1e29e672396ec777213acd308f4cc95e2e
@yqylovy what makes you say it's not clean code?
When there is an errors
packet, it will directly modify the stack, so different inputs will cause different behaviors.
make it configurable. https://github.com/uber-go/zap/compare/master...yqylovy:master
Since I use pkg/errors, each error satisfies the
fmt.Formatter
interface and thus, every error log comes with a cause trace in theerrorVerbose
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 https://github.com/uber-go/zap/issues/650