-
Notifications
You must be signed in to change notification settings - Fork 219
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
simplified, self-contained Logger #360
Comments
can't believe it took us this long to get to the point where we can talk about this :) |
/assign A first implementation is showing signs of life... |
Actually, there is already k8s.io/klog/v2/textlogger. I just reimplemented it in a slightly different (and better) way... 😅 I'll update it instead of adding a new logger. |
The solution that I came up with installs textlogger with
But this approach has one drawback: a traditional
In other words, such a switch only makes sense once most of the log calls in a component have been converted to structured logging. |
Writing with an info buffer definitely improves performance:
|
PR #362 contains the changes for split output. The buffering of the info stream is implemented in the io.Writer used by k8s.io/component-base/logs. I don't have a PR open for that yet (depends on kubernetes/kubernetes#114609). |
Actually, I had used a different approach for that there: by looking at the first byte of a write, the |
/kind feature
Describe the solution you'd like
In Kubernetes, we currently use the traditional klog output handling code, with all the cruft that has accumulated there. Since the deprecation of klog flags, none of that code does anything anymore, but we also cannot remove it because it is part of klog/v2.
What would be useful for Kubernetes would be a klogr Logger which:
The restructuring of klog into separate packages for vmodule and formatting should make the implementation of such a logger relatively easy.
The text was updated successfully, but these errors were encountered: