-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
chore: add prefixes to log messages #7625
Conversation
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Here it is logged without the prefix |
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.
LGTM
Left one comment
Co-authored-by: simar7 <1254783+simar7@users.noreply.github.com>
Co-authored-by: simar7 <1254783+simar7@users.noreply.github.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@nikpivkin It is called via |
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.
LGTM
@knqyf263 Is there an advantage of using context for logging over using a logger with a prefix as a field? Then there would be no need for context. |
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.
LGTM
It seems more intuitive and preferable to define a new logger rather than a context if the prefix is closed within a specific package. In this case, however, the prefix needed to be propagated over packages (over context). Other approaches are:
Using a context looks better. Does it answer your question? |
@knqyf263 Yeah, thanks. |
@aquasecurity/trivy I believe that |
Description
Adding prefixes for each artifact.
Before
After
Checklist