-
Notifications
You must be signed in to change notification settings - Fork 63
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
GMC: enhance log #371
GMC: enhance log #371
Conversation
Signed-off-by: KfreeZ <[email protected]>
Signed-off-by: KfreeZ <[email protected]>
return true | ||
} | ||
if !reflect.DeepEqual(oldObject.DeletionTimestamp, newObject.DeletionTimestamp) { | ||
fmt.Printf("Metadata changes detected, DeletionTimestamp changed from %v to %v\n", oldObject.DeletionTimestamp, newObject.DeletionTimestamp) | ||
_log.Info("Metadata.DeletionTimestamp changes detected", "old", oldObject.DeletionTimestamp, "new", newObject.DeletionTimestamp) |
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.
Shall this be on Debug level instead of Info level?
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.
from my view, this information is kind of useful for me, to know what condition trigger the reconcile, we don't want unexpected reconcile, if we hide this information to Debug, it would be less easier to find out such problem, espically for un-experienced developers.
Besides, there is no log.Debug, instead, it's log.V(2).Info
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.
We should add an option when controller start, to let user select the log level they want to set, eg: --logLevel debug
in such case, they can have much info in logs.
It does not make sense to have most info output to Info level by default.
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.
We should add an option when controller start, to let user select the log level they want to set, eg:
--logLevel debug
in such case, they can have much info in logs. It does not make sense to have most info output to Info level by default.
it's implemented
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
Signed-off-by: KfreeZ <[email protected]>
Signed-off-by: KfreeZ <[email protected]>
Signed-off-by: KfreeZ <[email protected]>
Signed-off-by: KfreeZ <[email protected]>
Signed-off-by: KfreeZ <[email protected]>
Thanks @KfreeZ for adding this support, Can we change it a little bit to better relflect HTTP VERBs? like: curl -X GET "http://localhost:8008/loglevel -- this will return current loglevel for user |
Signed-off-by: KfreeZ <[email protected]>
Signed-off-by: KfreeZ <[email protected]>
for more information, see https://pre-commit.ci
done |
Description
Use standard log to replace the fmt.Printf functions
use
curl -X GET "http://localhost:8008/loglevel?level=debug"
andcurl -X GET "http://localhost:8008/loglevel?level=info"
to change the debug levelIssues
n/a
.Type of change
List the type of change like below. Please delete options that are not relevant.
Dependencies
n/a
.Tests
no new feature, CI/CD covers the regression tests