-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add a log-level flag to set the log verbosity level #380
Add a log-level flag to set the log verbosity level #380
Conversation
Codecov Report
@@ Coverage Diff @@
## main #380 +/- ##
==========================================
- Coverage 68.45% 67.54% -0.92%
==========================================
Files 23 23
Lines 1693 1716 +23
==========================================
Hits 1159 1159
- Misses 462 485 +23
Partials 72 72
|
Thanks for this PR @NilanjanDaw, Is it possible to add some sample log output for both levels. |
Added sample log details to the PR under |
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
Isn't it that with increasing log verbose levels we get more logs. source - https://github.com/go-logr/logr#how-do-i-choose-my-v-levels. Also, Do you see installers detailed logs with increased log level verbosity? |
If we are to enable mulit-level verbosity then I think we need to modify our logging statements from @pshail @dharmjit @anusha94 Is that something we want to do? |
as long as the set verbosity level is used across the instance of the run we should be fine, keeping different level at different part of the code pieces can get very confusing. |
Setting two log levels, a log level of 0 prints Info level logs and above, while log level of 1 and above prints error logs only
- Update the flag handling library from go-flag to pflag - Hide unnecessary commandline flags - Set default log level to 0 - set installer log level at 1
9aeffca
to
f80281a
Compare
Make sure to squash the commits and messages before merge. |
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
What this PR does / why we need it:
Enabled k8s complaint logging, and set default info log level at 0, and installer info log at 1. This also enables a
v
flag to explicitly set the verbosity level.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #265
Additional Information:
Sample logs when verbosity. is set at
v
1:./bin/byoh-hostagent-linux-amd64 -v=1
Sample logs when verbosity is set at
v
0:./bin/byoh-hostagent-linux-amd64 -v=0