-
Notifications
You must be signed in to change notification settings - Fork 574
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
append stack multiline with zerolog.NewConsoleWriter() #157
Comments
+1
Tried to achieve using custom function on :
I would appreciate if there is another solution. |
@inoam I use a hack method reslove it : ) func ESPackMarshalStack(err error) interface{} {
type stackTracer interface {
StackTrace() errors.StackTrace
}
e, ok := err.(stackTracer)
if !ok {
return nil
}
//It's mean when env=dev just print track
if utils.Env.Dev() {
for _, frame := range e.StackTrace() {
fmt.Printf("%+s:%d\r\n", frame, frame)
}
} else {
return pkgerrors.MarshalStack(err)
}
return nil
} |
You might want #416. |
while developing and using the zerolog.NewConsoleWriter(), i would like to append the stack in a new line (nicely formatted multiline string) instead of inline as an attribute
(maybe this way i can cmd+click it in intellij)
any hints are very welcome?
The text was updated successfully, but these errors were encountered: