-
Notifications
You must be signed in to change notification settings - Fork 55
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
Implement Logging Guidelines #251
Comments
I don't mind working on this. It seems to me it would be good to refactor the code a bit as well to get rid of all the Fatal calls and just return errors. I can just replace the calls, but honestly, it's not that great and also a bit ugly. What do you think? |
Rewrote error handling not to use Fatal in the executable code: tchap@2d0108b . Let me know whether this is acceptable, I just played around this optimistically and I don't want to intrude, so I can as well just discard it, but it will have to be done, eventually. |
I'm good with ErrorS instead of Fatal. Update the logging guidelines if needed. Since we do t have CI setup yet, can you run the e2e test locally and post a snip of your results? |
/assign |
Also let me know how far you want to push this. Reading up on the current Kubernetes standards, the trend is to move to
I think that contextual logging is pretty nice, it allows you to attach additional information to log entries. It obviously comes with some extra cost like replacing loggers in |
@tchap can you please provide a link(s) to these current standards? I think we should include this link(s) within our logging docs.
I'm in favor of moving to |
Sure, it's right in the doc that is linked from |
To be clear, the doc is 2 years old, but I haven't found anything more up to date. It's in sync with what It seems you can use both klog and logr, but if there is any substantial work being done on logging, I would vote for moving away from using global package loggers like |
I think that this is implemented now, except perhaps the tooling to check incoming PRs. When implementing this issue, I used https://pkg.go.dev/k8s.io/klog/hack/tools/logcheck . Not sure it can be used for PRs, but just linking in here just in case. |
I agree. I'm happy to consider this closed, I'll let @danehans make the final call however |
#182 defined logging conventions and guidelines for the project. These guidelines should be implemented throughout the project. We should also consider tooling to ensure PRs follow logging guidelines.
The text was updated successfully, but these errors were encountered: