-
Notifications
You must be signed in to change notification settings - Fork 92
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
feat(logging): exposing breadcrumbs gathered with errors.Wrap()/Wrapf()/etc when trySkip() fails #1404
base: main
Are you sure you want to change the base?
Conversation
} | ||
g.log.WithOptions(zap.AddCallerSkip(1)).Info(msg, | ||
zapPosition(l), | ||
zap.String("reason_error", reason), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, unfortunately, stripped the msg
(and frame
) from the errors. %w
seems to at least nicely unwrap the msg
at least, for a good compromise. The frame
might also be valuable, but for a different target user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use %+v
to unwrap full chain of errors if I correctly understand the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I tried that also, but it was too verbose. This seemed a good compromise.
Please use conventional commit names, like |
faa7401
to
4bf4718
Compare
Sorry about that, I misread the guide on it... |
Sorry, it is still not per conventional commits 🙂 https://www.conventionalcommits.org/en/v1.0.0/#summary You are adding a new feature, so you can use prefix For tests, use For updating CI/CD I use |
…()/etc when trySkip() fails The code, very nicely, gathers breadcrumbs as it goes deep in the structures while generating. Unfortunately, since these were not exposed during logging, it was very hard to determine where the issues originated in a complex OAD.
4bf4718
to
39ab34d
Compare
The code, very nicely, gathers breadcrumbs as it goes deep in the structures while generating. Unfortunately, since these were not exposed during logging, it was very hard to determine where the issues originated in a complex OAD.
Added also a couple of names to some errors, for more "bread-crumbing".