-
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
[]byte will use +%v through InfoS. #236
Comments
/assign |
Oops, sorry @njuptlzf for not notice this |
Everything is for the development of the community, cheers. :) |
This didn't solve the problem for JSON. There the byte slice will be dumped as a base64 encoded string representation of the bytes. IMHO the right solution for byte slices that are meant to be treated like strings is to convert to string before logging. Let's reopen to discuss this further. We may have to put this into the migration guide. /reopen |
@pohly: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thanks, @pohly for pointing this out, I agree with
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
We have that now, so let's assume that this is indeed resolved. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind bug
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
print:
I0508 19:35:13.452661 57319 testKlog.go:11] "[]byte" b1=[104 101 108 108 111 32 119 111 114 108 100]
What did you expect to happen:
I0508 19:37:01.473191 2045 testKlog.go:11] "[]byte" b1="hello world"
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
part of kubernetes/kubernetes#101714
As k8s conducts structured log migration,
InfoS
is used more and more, but[]byte
, usually cooperates with %qbefore
the migration, is it necessary to submit a PR so that []byte uses %q in InfoS?Currently in InfoS, []byte uses %+v.
klog/klog.go
Line 832 in 0cc9b83
If the idea is approved, I will do it, otherwise I will probably continue to use
klog.InfoS("[]byte", "b1", string([]byte("hello world")))
.The text was updated successfully, but these errors were encountered: