-
Notifications
You must be signed in to change notification settings - Fork 432
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
Respect log format flag/config for stdout logs #1770
Conversation
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.
Does it make sense to have UTs for this change? What if we break the new behavior later accidentally
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.
@ashmeenkaur I left some comment. Please address.
Added unit tests for SetLogFormat method, however adding tests for main is difficult and it will essentially be an integration test. |
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.
@ashmeenkaur I added some more comments. Please address.
@ashmeenkaur Could you please share the link to the passed integration test run? |
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 with a nitpick and a fix expected in a future PR.
Added to the PR description |
Co-authored-by: Nitin Garg <113666283+gargnitingoogle@users.noreply.github.com>
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, with a future non-blocking fix pending.
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. one minor comment.
* respect log format flag/config for stdout logs. * add unit test * review comments * review comments * Update main.go Co-authored-by: Nitin Garg <113666283+gargnitingoogle@users.noreply.github.com> * review comments --------- Co-authored-by: Nitin Garg <113666283+gargnitingoogle@users.noreply.github.com>
Description
Background: A default logger with log format json is created using golang init() function. This logger logs the output to stdout/stderr until explict logger is created based on user specified configuration/flags.
This PR includes changes to ensure that init logger respects the user specified log format.
Link to the issue in case of a bug fix.
NA
Testing details