-
Notifications
You must be signed in to change notification settings - Fork 218
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
structured logging: support values with line breaks #273
Conversation
Structured logging with InfoS is formatted differently than traditional output, so it's worthwhile to have an example that demostrates that. The new example didn't compile initially because an older version of klog was used. This gets avoids by always using the source from the current directory.
There is a mechanism for allocating smallish buffers (< 256 bytes) only once and then reusing them. Doing that for the structured key/value pairs is an improvement (measured with kubernetes/kubernetes#106594): $ $GOPATH/bin/benchstat /tmp/original /tmp/reuse-buffer name old time/op new time/op delta Logging/container/structured-36 41.6µs ± 1% 41.6µs ± 1% ~ (p=1.000 n=5+5) Logging/error-value/structured-36 4.01µs ± 3% 3.37µs ± 3% -16.01% (p=0.008 n=5+5) Logging/error/structured-36 3.91µs ± 1% 3.33µs ± 3% -14.90% (p=0.008 n=5+5) Logging/simple/structured-36 3.54µs ± 3% 2.98µs ± 3% -15.77% (p=0.008 n=5+5) Logging/values/structured-36 6.83µs ± 2% 5.31µs ± 5% -22.34% (p=0.008 n=5+5) name old alloc/op new alloc/op delta Logging/container/structured-36 10.4kB ± 0% 10.5kB ± 0% +0.61% (p=0.008 n=5+5) Logging/error-value/structured-36 432B ± 0% 320B ± 0% -25.93% (p=0.008 n=5+5) Logging/error/structured-36 448B ± 0% 336B ± 0% -25.00% (p=0.008 n=5+5) Logging/simple/structured-36 408B ± 0% 296B ± 0% -27.45% (p=0.008 n=5+5) Logging/values/structured-36 777B ± 0% 505B ± 0% -35.01% (p=0.008 n=5+5) name old allocs/op new allocs/op delta Logging/container/structured-36 64.0 ± 0% 64.0 ± 0% ~ (all equal) Logging/error-value/structured-36 9.00 ± 0% 7.00 ± 0% -22.22% (p=0.008 n=5+5) Logging/error/structured-36 10.0 ± 0% 8.0 ± 0% -20.00% (p=0.008 n=5+5) Logging/simple/structured-36 8.00 ± 0% 6.00 ± 0% -25.00% (p=0.008 n=5+5) Logging/values/structured-36 16.0 ± 0% 13.0 ± 0% -18.75% (p=0.008 n=5+5)
We can avoid several allocations and use faster code (= strconv.Quote) by relying less on Sprintf. $ $GOPATH/bin/benchstat /tmp/reuse-buffer /tmp/strconv name old time/op new time/op delta Logging/container/structured-36 41.6µs ± 1% 39.5µs ± 2% -5.05% (p=0.008 n=5+5) Logging/error-value/structured-36 3.37µs ± 3% 3.13µs ± 0% -7.06% (p=0.016 n=5+4) Logging/error/structured-36 3.33µs ± 3% 3.09µs ± 2% -7.10% (p=0.008 n=5+5) Logging/simple/structured-36 2.98µs ± 3% 2.86µs ± 4% ~ (p=0.095 n=5+5) Logging/values/structured-36 5.31µs ± 5% 4.77µs ± 4% -10.17% (p=0.008 n=5+5) name old alloc/op new alloc/op delta Logging/container/structured-36 10.5kB ± 0% 9.3kB ± 0% -11.01% (p=0.008 n=5+5) Logging/error-value/structured-36 320B ± 0% 312B ± 0% -2.50% (p=0.008 n=5+5) Logging/error/structured-36 336B ± 0% 312B ± 0% -7.14% (p=0.008 n=5+5) Logging/simple/structured-36 296B ± 0% 288B ± 0% -2.70% (p=0.008 n=5+5) Logging/values/structured-36 505B ± 0% 464B ± 0% -8.12% (p=0.008 n=5+5) name old allocs/op new allocs/op delta Logging/container/structured-36 64.0 ± 0% 62.0 ± 0% -3.12% (p=0.008 n=5+5) Logging/error-value/structured-36 7.00 ± 0% 6.00 ± 0% -14.29% (p=0.008 n=5+5) Logging/error/structured-36 8.00 ± 0% 6.00 ± 0% -25.00% (p=0.008 n=5+5) Logging/simple/structured-36 6.00 ± 0% 5.00 ± 0% -16.67% (p=0.008 n=5+5) Logging/values/structured-36 13.0 ± 0% 11.0 ± 0% -15.38% (p=0.008 n=5+5)
Checking common types first is slightly faster. No difference for simple benchmarks: $ $GOPATH/bin/benchstat /tmp/strconv /tmp/reorder name old time/op new time/op delta Logging/container/structured-36 39.5µs ± 2% 39.6µs ± 1% ~ (p=1.000 n=5+5) Logging/error-value/structured-36 3.13µs ± 0% 3.14µs ± 4% ~ (p=0.730 n=4+5) Logging/error/structured-36 3.09µs ± 2% 3.13µs ± 3% ~ (p=0.548 n=5+5) Logging/simple/structured-36 2.86µs ± 4% 2.91µs ± 2% ~ (p=0.310 n=5+5) Logging/values/structured-36 4.77µs ± 4% 4.77µs ± 5% ~ (p=0.841 n=5+5) name old alloc/op new alloc/op delta Logging/container/structured-36 9.35kB ± 0% 9.35kB ± 0% ~ (p=0.095 n=5+4) Logging/error-value/structured-36 312B ± 0% 312B ± 0% ~ (all equal) Logging/error/structured-36 312B ± 0% 312B ± 0% ~ (all equal) Logging/simple/structured-36 288B ± 0% 288B ± 0% ~ (all equal) Logging/values/structured-36 464B ± 0% 464B ± 0% ~ (all equal) name old allocs/op new allocs/op delta Logging/container/structured-36 62.0 ± 0% 62.0 ± 0% ~ (all equal) Logging/error-value/structured-36 6.00 ± 0% 6.00 ± 0% ~ (all equal) Logging/error/structured-36 6.00 ± 0% 6.00 ± 0% ~ (all equal) Logging/simple/structured-36 5.00 ± 0% 5.00 ± 0% ~ (all equal) Logging/values/structured-36 11.0 ± 0% 11.0 ± 0% ~ (all equal) It's a bigger win for a real kubelet log: $ $GOPATH/bin/benchstat /tmp/strconv-kubelet /tmp/reorder-kubelet name old time/op new time/op delta Logging/v5/kubelet/structured-36 1.17s ± 2% 1.15s ± 1% -1.37% (p=0.016 n=5+5) name old alloc/op new alloc/op delta Logging/v5/kubelet/structured-36 525MB ± 0% 525MB ± 0% ~ (p=0.548 n=5+5) name old allocs/op new allocs/op delta Logging/v5/kubelet/structured-36 3.86M ± 0% 3.86M ± 0% ~ (p=0.079 n=5+5) Args: total: 310746 strings: 106904 (34%) with line breaks: 11 (0% of all arguments) with API objects: 529 (0% of all arguments) types and their number of usage: Container:529 numbers: 14563 (4%) ObjectRef: 169306 (54%) others: 19973 (6%)
I'd like to propose another enhancement for the new format: when some multi-line string contains the
This can be solved by indenting the text with a tab and the delimiter with a single space:
The reason why I didn't implement that from the beginning is that I was worried about indenting too much and making it less readable when the lines then don't fit into a narrow console anymore. Another alternative would be to use two spaces, at the cost of making the output slightly larger. Thoughts? |
I'm honestly not sure this is better. It feels very ad-hoc. Is there a semi-formal grammaar for how one should expect to parse such a long line? |
Here's one:
Note that struct, map and list are basically unparsable reliably when embedded inside a single line because the output of |
Here's an example for logstash/grok. To try it out, use https://grokdebug.herokuapp.com/ and enter
Post-processing is required in logstash to remove quoting in QUOTEDSTRING and the leading tab in MULTILINE. |
A simpler grok pattern would just match for the header at the start of a line and then greedily match the entire rest of the message. That would be similar to the existing fluentd example in k/k. With this PR, such an approach works reliably. Without it, it doesn't. |
@serathius I pushed another commit with the tab character for indention. Can you take another look? |
@thockin: please also take another look. See the comments above about approaches for parsing the revised format. |
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.
Is this >>><<<
format something you made up or is it some standard I don't know?
I'm mostly concerned that we don't make up syntax on the fly (which, IME, always ends in tears).
klog.go
Outdated
case []byte: | ||
b.WriteString(fmt.Sprintf("%s=%+q", k, v)) | ||
// We cannot use the simpler strconv.Quote here |
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.
This doesn't seem correct - should we fix it?
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.
According to the PR which introduced the corresponding test case, %+q
was intentionally used to handle non-printable characters: #237 (comment)
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.
I kind of disagree with that PR - if you pass a []byte, there's NOTHING that requires it be a printable string. If you want a string, convert it to a string. Funcr does not do that, for example.
Aside from that - do we make assertions that our log output will always be ASCII? We do not do this format checking for keys
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.
I don't have any background about why it was decided to handle bytes that way. But because I don't know, I also don't want to change established behavior in this PR.
@serathius, @dims: do you remember?
I made it up after trying out some other alternatives, including delimiters like
I don't mind using some established convention, but it has to fit into the key/value pair flow and shouldn't be too verbose because log volume is still a concern. Analysis of a kubelet log showed that messages with line breaks were rare, but perhaps they are more common elsewhere. |
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.
I don't mind using some established convention, but it has to fit into the key/value pair flow and shouldn't be too verbose because log volume is still a concern. Analysis of a kubelet log showed that messages with line breaks were rare, but perhaps they are more common elsewhere.
I don't have a particular convention in mind (other than not doing multi-line
at all, which is my preference and please don't ever send a PR to make funcr do
this :)
I recognize that it's already effectively unparseable today, so we're not
making it much worse. But it's not really much better.
This form adds a trailing newline to multi-line strings which don't have one,
which is kind of a corruption. That's one concern I have, but maybe it is
overlookable.
Looking at it from first-principles, the "right" way to do this is to define an
escape, process the (arbitrary) content for that escape, and then render.
E.g. key=<A string with multi-line capabilities but \> close bracket needs escape
.
This is non-standard and slow. If you don't do it, though, the string could
contain the special-string terminator and confuse parsers. So you chose >>>
and <<<
since Go's %+v
doesn't use it and they are less likely to occur
naturally (interesting you put them in the non-natural (to me) directions).
But you actually defined your own own escape - the leading character of the
line. In theory, you could simply use <
and >
since you know the
end-of-string indicator ( >
) can only be found at the 0th character on a new
line. But to ensure that, you need to corrupt that trailing newline.
What if you ALWAYS add a trailing newline? Sometimes you would end up with
blank lines but at least it would be parseable.
E.g. consider input values A="foo\bar" and B="qux\nzorb\n"
Your log output could look like:
<header...> A=<foo
<tab> bar
> B=<qux
<tab> zorb
>
Note I retained the '=' for human's sake, and I used <
and >
since Go's %+v
doesn't use them (I think?). You could use << >>
or ( )
or (( ))
if you
prefer, or keep >>> <<<
. It doesn't matter. I like the =
personally - it
makes the key=value notion regular.
You could make it maybe even easier by always adding a leading newline:
<header...> A=<
<tab> foo
<tab> bar
> B=<
<tab> qux
<tab> zorb
>
That's easier to read by far and still unambiguous, I think. Any line that
starts with a tab is part of a multi-line, and any line that starts with a
space is a "continue" line. Just make sure that it's not possible to trip that
up with ill-formed keys or logger names or (heaven help me) file names that
start with spaces (play stupid games, win stupid prizes?).
Now, I'll restate my preference: don't even open this can of worms :) But if
we're going to do it in non-JSON output mode, at least we can say we really
thought it out, and show our work.
klog.go
Outdated
case []byte: | ||
b.WriteString(fmt.Sprintf("%s=%+q", k, v)) | ||
// We cannot use the simpler strconv.Quote here |
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.
I kind of disagree with that PR - if you pass a []byte, there's NOTHING that requires it be a printable string. If you want a string, convert it to a string. Funcr does not do that, for example.
Aside from that - do we make assertions that our log output will always be ASCII? We do not do this format checking for keys
Before I comment, let me point out that we discussed the purpose of this text format in last weeks structured logging working group meeting and the conclusion was captured by @serathius in kubernetes/community#6255. The key part for this PR is that the purpose of the text format is:
Note that machine-parsing is not a goal. JSON does that so much better (faster, well-defined), it really should be used if that is how log output will be used. Avoiding ambiguity in the output and thus making it somewhat machine-parsable is a nice additional benefit, but comes second after human-readable. That's why always using quoted strings is bad. |
I won't, because funcr serves a different purpose. It's goal is machine-parsing, while this format here is for humans.
It's better for humans 😁
I was aware of that downside and should have mentioned it. There are test cases for both. I now also added that to the code comments.
The main reason why I chose indention over escaping is that we want compatibility with the traditional format. That format hasn't been formally specified, but what people do in practice is to break at those lines that start with the special klog header. If I wanted to avoid indention, I would have to escape that header. I chose
See above. Any line emitted without a leading whitespace is a risk for confusing existing parsers which don't know about this new format.
I decided against that because it prioritizes accuracy over readability. I'm also not sure whether developers seeing such a blank line would understand that it's not a bug, but rather a feature.
I don't have a problem with using One small advantage of a longer delimiter is that it is easier to fast-forward by searching for
I had already written a comment about that when I got to this part 😁 Yes, let's keep this additional newline.
Exactly.
Me neither. If developers want to shoot themselves in the foot, we should let them.
So do we agree that we only need to settle on the exact delimiters and otherwise the PR is okay (with some comment updates)? Let's give @serathius and @shivanshu1333 some time to comment, then I'll switch to |
I like the Whether
I think it helps reading a lot. Will take another look at the PR |
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.
Let me know when to look again, if you do add comments, change the delimiters, and/or add the leading newline
801bc67
to
68e5e83
Compare
klog.go
Outdated
} | ||
|
||
// Complex multi-line string, show as-is with indention like this: | ||
// I... "hello world" key>>> |
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.
so my only issues are:
- to add "=" or not
- delimiters
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.
My preference is =<
with newline at the start and >
at the end.
The initial structured logging output (almost) always produced a single line per log message, with quoting of strings to represent line breaks as \n. This made the output hard to read (see kubernetes/kubernetes#104868). It was still possible to get line breaks when formatting a value with `%+v` and that ended up emitting line breaks; this was probably not intended. Now string values are only quoted if they contain no line break. If they do, start/end markers delimit the text which appears on its own lines, with indention to ensure that those additional lines are not accidentally treated as a new log message when they happen to contain the klog header. It also makes the output more readable. Tabs are used as indention for the value because it makes it stand out visually and because it ensures that inline ">" characters are not mistaken for the end-of-value delimiter. The result of `fmt.Sprintf("%+v")` is printed verbatim without quoting when it contains no line break, otherwise as multi-line value with delimiter and indention. Traditional output: I1112 14:06:35.783354 328441 structured_logging.go:42] someData printed using InfoF: {hello world 0} I1112 14:06:35.783472 328441 structured_logging.go:43] longData printed using InfoF: {long Multiple lines with quite a bit of text. 0} I1112 14:06:35.783483 328441 structured_logging.go:44] stringData printed using InfoF, with the message across multiple lines: long: Multiple lines with quite a bit of text. I1112 14:06:35.898176 142908 structured_logging.go:54] logData printed using InfoF: {log output from some program I0000 12:00:00.000000 123456 main.go:42] Starting E0000 12:00:01.000000 123456 main.go:43] Failed for some reason 0} Old InfoS output before this commit: I1112 14:06:35.783512 328441 structured_logging.go:50] "using InfoS" someData={Name:hello Data:world internal:0} I1112 14:06:35.783529 328441 structured_logging.go:51] "using InfoS" longData={Name:long Data:Multiple lines with quite a bit of text. internal:0} I1112 14:06:35.783549 328441 structured_logging.go:52] "using InfoS with\nthe message across multiple lines" int=1 stringData="long: Multiple\nlines\nwith quite a bit\nof text." str="another value" I1112 14:06:35.783565 328441 structured_logging.go:61] "Did something" item="foobar" I1112 14:06:35.783576 328441 structured_logging.go:63] "This is a full sentence." item="foobar" I1112 14:06:35.898278 142908 structured_logging.go:65] "using InfoS" logData={Name:log output from some program Data:I0000 12:00:00.000000 123456 main.go:42] Starting E0000 12:00:01.000000 123456 main.go:43] Failed for some reason internal:0} New InfoS output: I1126 10:31:50.378182 121736 structured_logging.go:58] "using InfoS" someData={Name:hello Data:world internal:0} I1126 10:31:50.378204 121736 structured_logging.go:59] "using InfoS" longData=< {Name:long Data:Multiple lines with quite a bit of text. internal:0} > I1126 10:31:50.378228 121736 structured_logging.go:60] "using InfoS with\nthe message across multiple lines" int=1 stringData=< long: Multiple lines with quite a bit of text. > str="another value" I1126 10:31:50.378249 121736 structured_logging.go:65] "using InfoS" logData=< {Name:log output from some program Data:I0000 12:00:00.000000 123456 main.go:42] Starting E0000 12:00:01.000000 123456 main.go:43] Failed for some reason internal:0} > Performance is the same as before in most cases. Handling of a v1.Container struct with line breaks in the output gets faster, probably because printing each line individually is more efficient than quoting. $ $GOPATH/bin/benchstat /tmp/reorder /tmp/multi-line name old time/op new time/op delta Logging/container/structured-36 39.6µs ± 1% 21.5µs ± 0% -45.82% (p=0.008 n=5+5) Logging/error-value/structured-36 3.14µs ± 4% 3.11µs ± 2% ~ (p=0.548 n=5+5) Logging/error/structured-36 3.13µs ± 3% 3.13µs ± 3% ~ (p=1.000 n=5+5) Logging/simple/structured-36 2.91µs ± 2% 2.87µs ± 2% ~ (p=0.310 n=5+5) Logging/values/structured-36 4.77µs ± 5% 4.75µs ± 4% ~ (p=1.000 n=5+5) name old alloc/op new alloc/op delta Logging/container/structured-36 9.35kB ± 0% 9.59kB ± 0% +2.59% (p=0.016 n=4+5) Logging/error-value/structured-36 312B ± 0% 312B ± 0% ~ (all equal) Logging/error/structured-36 312B ± 0% 312B ± 0% ~ (all equal) Logging/simple/structured-36 288B ± 0% 288B ± 0% ~ (all equal) Logging/values/structured-36 464B ± 0% 464B ± 0% ~ (all equal) name old allocs/op new allocs/op delta Logging/container/structured-36 62.0 ± 0% 63.0 ± 0% +1.61% (p=0.008 n=5+5) Logging/error-value/structured-36 6.00 ± 0% 6.00 ± 0% ~ (all equal) Logging/error/structured-36 6.00 ± 0% 6.00 ± 0% ~ (all equal) Logging/simple/structured-36 5.00 ± 0% 5.00 ± 0% ~ (all equal) Logging/values/structured-36 11.0 ± 0% 11.0 ± 0% ~ (all equal)
68e5e83
to
fafe98e
Compare
@serathius : I've switched to |
LGTM, @thockin any remaining comments? |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pohly, serathius, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
@pohly thanks for all the changes, the output looks much better now! |
Done. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [k8s.io/klog](https://togithub.com/kubernetes/klog) | require | major | `v1.0.0` -> `v2.110.1` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>kubernetes/klog (k8s.io/klog)</summary> ### [`v2.110.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.110.1): Prepare klog release for Kubernetes v1.29 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.100.1...v2.110.1) #### What's Changed - fix: SetLogger via klog.SetLogger will output an unexpected newline by [@​aimuz](https://togithub.com/aimuz) in [https://github.com/kubernetes/klog/pull/378](https://togithub.com/kubernetes/klog/pull/378) - resolve comments warning by [@​lowang-bh](https://togithub.com/lowang-bh) in [https://github.com/kubernetes/klog/pull/379](https://togithub.com/kubernetes/klog/pull/379) - stderrthreshold: fix flag comment by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/376](https://togithub.com/kubernetes/klog/pull/376) - enable "go vet" checks for parameters by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/390](https://togithub.com/kubernetes/klog/pull/390) - promote experimental code to stable by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/392](https://togithub.com/kubernetes/klog/pull/392) - golangci-lint action by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/380](https://togithub.com/kubernetes/klog/pull/380) - output: handle WithName like zapr does by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/391](https://togithub.com/kubernetes/klog/pull/391) - slog support + logr 1.3.0 update by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/384](https://togithub.com/kubernetes/klog/pull/384) #### New Contributors - [@​aimuz](https://togithub.com/aimuz) made their first contribution in [https://github.com/kubernetes/klog/pull/378](https://togithub.com/kubernetes/klog/pull/378) - [@​lowang-bh](https://togithub.com/lowang-bh) made their first contribution in [https://github.com/kubernetes/klog/pull/379](https://togithub.com/kubernetes/klog/pull/379) **Full Changelog**: kubernetes/klog@v2.100.1...v2.110.1 ### [`v2.100.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.100.1): Prepare klog release for Kubernetes v1.28 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.90.1...v2.100.1) #### What's Changed - expose logBridge via NewStandardLog() by [@​mikedanese](https://togithub.com/mikedanese) in [https://github.com/kubernetes/klog/pull/369](https://togithub.com/kubernetes/klog/pull/369) - add Format wrapper by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/374](https://togithub.com/kubernetes/klog/pull/374) - JSON as fallback encoding by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/375](https://togithub.com/kubernetes/klog/pull/375) #### New Contributors - [@​mikedanese](https://togithub.com/mikedanese) made their first contribution in [https://github.com/kubernetes/klog/pull/369](https://togithub.com/kubernetes/klog/pull/369) **Full Changelog**: kubernetes/klog@v2.90.1...v2.100.1 ### [`v2.90.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.90.1): Prepare klog release for Kubernetes v1.27 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.90.0...v2.90.1) #### What's Changed - buffer: restore dropping of too large buffers by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/366](https://togithub.com/kubernetes/klog/pull/366) - ktesting improvements by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/365](https://togithub.com/kubernetes/klog/pull/365) - ktesting + textlogger config api by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/368](https://togithub.com/kubernetes/klog/pull/368) - textlogger write through by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/363](https://togithub.com/kubernetes/klog/pull/363) **Full Changelog**: kubernetes/klog@v2.90.0...v2.90.1 ### [`v2.90.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.90.0): Prepare klog release for Kubernetes v1.27 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.80.1...v2.90.0) #### What's Changed - klog: benchmark the overhead when logging is off by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/355](https://togithub.com/kubernetes/klog/pull/355) - improve textlogger by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/362](https://togithub.com/kubernetes/klog/pull/362) **Full Changelog**: kubernetes/klog@v2.80.1...v2.90.0 ##### There are some API differences from previous version k8s.io/klog/v2/klogr contains incompatible changes: - klogger.Enabled: removed - klogger.Error: removed - klogger.Info: removed k8s.io/klog/v2/test contains incompatible changes: - InitKlog: changed from func() to func(testing.TB) *flag.FlagSet ### [`v2.80.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.80.1): Prepare klog release for Kubernetes v1.26 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.80.0...v2.80.1) #### What's Changed - InitFlags concurrency fix by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/349](https://togithub.com/kubernetes/klog/pull/349) **Full Changelog**: kubernetes/klog@v2.80.0...v2.80.1 ### [`v2.80.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.80.0): Prepare klog release for Kubernetes v1.26 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.70.1...v2.80.0) #### What's Changed - OWNERS: add harshanarayana by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/342](https://togithub.com/kubernetes/klog/pull/342) - kvlistformat: fix the issue with display marshalled value for non string type by [@​harshanarayana](https://togithub.com/harshanarayana) in [https://github.com/kubernetes/klog/pull/344](https://togithub.com/kubernetes/klog/pull/344) - Bump version of golang to 1.19 and drop older versions by [@​dims](https://togithub.com/dims) in [https://github.com/kubernetes/klog/pull/345](https://togithub.com/kubernetes/klog/pull/345) **Full Changelog**: kubernetes/klog@v2.70.1...v2.80.0 ### [`v2.70.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.70.1): Prepare klog release for Kubernetes v1.25 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.70.0...v2.70.1) #### What's Changed - ktesting: handle test completion by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/337](https://togithub.com/kubernetes/klog/pull/337) - contextual logging: enable by default again by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/341](https://togithub.com/kubernetes/klog/pull/341) **Full Changelog**: kubernetes/klog@v2.70.0...v2.70.1 ### [`v2.70.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.70.0): Prepare klog release for Kubernetes v1.25 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.60.1...v2.70.0) #### What's Changed - logcheck: contextual logging + enhanced checks by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/297](https://togithub.com/kubernetes/klog/pull/297) - hack/tools: drop dependency on golangci-lint by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/313](https://togithub.com/kubernetes/klog/pull/313) - StopFlushDaemon: document flushing on shutdown by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/314](https://togithub.com/kubernetes/klog/pull/314) - logcheck: fix detection of invalid \* regexp in filter by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/315](https://togithub.com/kubernetes/klog/pull/315) - README.md: clarify -logtostderr by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/319](https://togithub.com/kubernetes/klog/pull/319) - Trim duplicates by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/324](https://togithub.com/kubernetes/klog/pull/324) - replace KObjs with KObjSlice by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/322](https://togithub.com/kubernetes/klog/pull/322) - support logr.Marshaler by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/325](https://togithub.com/kubernetes/klog/pull/325) - internal: remove unused TrimDuplicates by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/326](https://togithub.com/kubernetes/klog/pull/326) - save and restore state by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/320](https://togithub.com/kubernetes/klog/pull/320) - GitHub: use apidiff with more recent Go by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/329](https://togithub.com/kubernetes/klog/pull/329) - remove hack/tools by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/330](https://togithub.com/kubernetes/klog/pull/330) - GIT-331: fix shadowing key from the kv pair by [@​harshanarayana](https://togithub.com/harshanarayana) in [https://github.com/kubernetes/klog/pull/332](https://togithub.com/kubernetes/klog/pull/332) - klog.Fatal backtrace revert by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/328](https://togithub.com/kubernetes/klog/pull/328) - ktesting: capture log data in memory by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/327](https://togithub.com/kubernetes/klog/pull/327) - GIT-275: add tests for int and struct keys by [@​harshanarayana](https://togithub.com/harshanarayana) in [https://github.com/kubernetes/klog/pull/333](https://togithub.com/kubernetes/klog/pull/333) #### New Contributors - [@​harshanarayana](https://togithub.com/harshanarayana) made their first contribution in [https://github.com/kubernetes/klog/pull/332](https://togithub.com/kubernetes/klog/pull/332) **Full Changelog**: kubernetes/klog@v2.60.1...v2.70.0 ### [`v2.60.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.60.1): Prepare klog release for Kubernetes v1.24 (Take 6) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.60.0...v2.60.1) #### What's Changed - Cleanup OWNERS file by [@​serathius](https://togithub.com/serathius) in [https://github.com/kubernetes/klog/pull/309](https://togithub.com/kubernetes/klog/pull/309) - dependencies: avoid k8s.io/utils, fork clock code instead by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/310](https://togithub.com/kubernetes/klog/pull/310) - promote contextual logging APIs to stable by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/311](https://togithub.com/kubernetes/klog/pull/311) **Full Changelog**: kubernetes/klog@v2.60.0...v2.60.1 ### [`v2.60.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.60.0): Prepare klog release for Kubernetes v1.24 (Take 5) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.50.2...v2.60.0) #### What's Changed - SetContextualLogger: remove unintentionally merged API call by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/308](https://togithub.com/kubernetes/klog/pull/308) **Full Changelog**: kubernetes/klog@v2.50.2...v2.60.0 ### [`v2.50.2`](https://togithub.com/kubernetes/klog/compare/v2.50.1...v2.50.2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.50.1...v2.50.2) ### [`v2.50.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.50.1): Prepare klog release for Kubernetes v1.24 (Take 4) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.50.0...v2.50.1) #### What's Changed - SetLoggerWithOptions: support flushing by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/306](https://togithub.com/kubernetes/klog/pull/306) **Full Changelog**: kubernetes/klog@v2.50.0...v2.50.1 ### [`v2.50.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.50.0): Prepare klog release for Kubernetes v1.24 (Take 3) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.40.1...v2.50.0) #### What's Changed - Panic on empty info with custom logr by [@​jklaw90](https://togithub.com/jklaw90) in [https://github.com/kubernetes/klog/pull/283](https://togithub.com/kubernetes/klog/pull/283) - Add missing Depth logging functions. by [@​s3rj1k](https://togithub.com/s3rj1k) in [https://github.com/kubernetes/klog/pull/280](https://togithub.com/kubernetes/klog/pull/280) - fix typo in klog.go by [@​cocaccola](https://togithub.com/cocaccola) in [https://github.com/kubernetes/klog/pull/270](https://togithub.com/kubernetes/klog/pull/270) - Update README.md by [@​noaabarki](https://togithub.com/noaabarki) in [https://github.com/kubernetes/klog/pull/281](https://togithub.com/kubernetes/klog/pull/281) - log filter: ignored by V, used during log call by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/290](https://togithub.com/kubernetes/klog/pull/290) - SetLogger/ClearLogger/SetLogFilter cleanup by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/289](https://togithub.com/kubernetes/klog/pull/289) - fixes for PR [#​280](https://togithub.com/kubernetes/klog/issues/280), refactoring, textlogger, unit test by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/287](https://togithub.com/kubernetes/klog/pull/287) - klogr verbosity by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/295](https://togithub.com/kubernetes/klog/pull/295) - test: fix Go version matrix by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/298](https://togithub.com/kubernetes/klog/pull/298) - handle panics in MarshalLog, Error, String by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/299](https://togithub.com/kubernetes/klog/pull/299) - Fix goroutine leak: make flushDaemon stoppable by [@​katexochen](https://togithub.com/katexochen) in [https://github.com/kubernetes/klog/pull/293](https://togithub.com/kubernetes/klog/pull/293) - structured logging: replacing Fatal/Exit/etc. without loss of flushing by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/303](https://togithub.com/kubernetes/klog/pull/303) - contextual logging by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/296](https://togithub.com/kubernetes/klog/pull/296) - remove side effects of tests by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/305](https://togithub.com/kubernetes/klog/pull/305) - tests: stop testing with Go 1.14 by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/304](https://togithub.com/kubernetes/klog/pull/304) #### New Contributors - [@​jklaw90](https://togithub.com/jklaw90) made their first contribution in [https://github.com/kubernetes/klog/pull/283](https://togithub.com/kubernetes/klog/pull/283) - [@​s3rj1k](https://togithub.com/s3rj1k) made their first contribution in [https://github.com/kubernetes/klog/pull/280](https://togithub.com/kubernetes/klog/pull/280) - [@​cocaccola](https://togithub.com/cocaccola) made their first contribution in [https://github.com/kubernetes/klog/pull/270](https://togithub.com/kubernetes/klog/pull/270) - [@​noaabarki](https://togithub.com/noaabarki) made their first contribution in [https://github.com/kubernetes/klog/pull/281](https://togithub.com/kubernetes/klog/pull/281) - [@​katexochen](https://togithub.com/katexochen) made their first contribution in [https://github.com/kubernetes/klog/pull/293](https://togithub.com/kubernetes/klog/pull/293) **Full Changelog**: kubernetes/klog@v2.40.1...v2.50.0 ### [`v2.40.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.40.1): Prepare klog release for Kubernetes v1.24 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.40.0...v2.40.1) #### What's Changed - Using OS targeted go files to separate out the username logic. by [@​phillipsj](https://togithub.com/phillipsj) in [https://github.com/kubernetes/klog/pull/271](https://togithub.com/kubernetes/klog/pull/271) - Recover from nil pointers when logging by [@​dims](https://togithub.com/dims) in [https://github.com/kubernetes/klog/pull/279](https://togithub.com/kubernetes/klog/pull/279) #### New Contributors - [@​phillipsj](https://togithub.com/phillipsj) made their first contribution in [https://github.com/kubernetes/klog/pull/271](https://togithub.com/kubernetes/klog/pull/271) **Full Changelog**: kubernetes/klog@v2.40.0...v2.40.1 ### [`v2.40.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.40.0): Prepare klog release for Kubernetes v1.24 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.30.0...v2.40.0) #### What's Changed - structured logging: support values with line breaks by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/273](https://togithub.com/kubernetes/klog/pull/273) - Fix klog lock release on panic error by [@​astraw99](https://togithub.com/astraw99) in [https://github.com/kubernetes/klog/pull/272](https://togithub.com/kubernetes/klog/pull/272) - add format test for KObjs by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/276](https://togithub.com/kubernetes/klog/pull/276) - add Verbose.InfoSDepth by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/277](https://togithub.com/kubernetes/klog/pull/277) #### Known Issues - [https://github.com/kubernetes/klog/issues/278](https://togithub.com/kubernetes/klog/issues/278) #### New Contributors - [@​astraw99](https://togithub.com/astraw99) made their first contribution in [https://github.com/kubernetes/klog/pull/272](https://togithub.com/kubernetes/klog/pull/272) **Full Changelog**: kubernetes/klog@v2.30.0...v2.40.0 ### [`v2.30.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.30.0): Prepare klog release for Kubernetes v1.23 (take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.20.0...v2.30.0) #### What's Changed - Fix logcheck exit function by [@​luyou86](https://togithub.com/luyou86) in [https://github.com/kubernetes/klog/pull/265](https://togithub.com/kubernetes/klog/pull/265) - custom marshaler for ObjectRef by [@​pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/266](https://togithub.com/kubernetes/klog/pull/266) #### New Contributors - [@​luyou86](https://togithub.com/luyou86) made their first contribution in [https://github.com/kubernetes/klog/pull/265](https://togithub.com/kubernetes/klog/pull/265) **Full Changelog**: kubernetes/klog@v2.20.0...v2.30.0 ### [`v2.20.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.20.0): Prepare klog release for Kubernetes v1.23 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.10.0...v2.20.0) Changes are here : kubernetes/klog@v2.10.0...v2.20.0 since we moved to logr v1.0.0, there are incompatible changes: - klogger.Enabled: changed from func() bool to func(int) bool - klogger.Info: changed from func(string, ...interface{}) to func(int, string, ...interface{}) - klogger.V: removed - klogger.WithCallDepth: changed from func(int) github.com/go-logr/logr.Logger to func(int) github.com/go-logr/logr.LogSink - klogger.WithName: changed from func(string) github.com/go-logr/logr.Logger to func(string) github.com/go-logr/logr.LogSink - klogger.WithValues: changed from func(...interface{}) github.com/go-logr/logr.Logger to func(...interface{}) github.com/go-logr/logr.LogSink [`83653a6`](https://togithub.com/kubernetes/klog/commit/83653a6deebf) Update to newest versions of golang 1.17.x [`d648c2e`](https://togithub.com/kubernetes/klog/commit/d648c2e42d30) fix file-based filtering symbolization [`8ee3d65`](https://togithub.com/kubernetes/klog/commit/8ee3d652c96b) export ClearLogger [`4171f3c`](https://togithub.com/kubernetes/klog/commit/4171f3c1be1b) Switching to logr tag v1.0.0 [`9ab3c2b`](https://togithub.com/kubernetes/klog/commit/9ab3c2b56cb2) add serathius as approvers of klog ### [`v2.10.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.10.0): One more change to support 1.22 release [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.9.0...v2.10.0) Changes are here : kubernetes/klog@v2.9.0...v2.10.0 new function added: func KObjs(arg interface{}) []ObjectRef ### [`v2.9.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.9.0): Prepare release for Kubernetes v1.22 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.8.0...v2.9.0) Changes are here : kubernetes/klog@v2.8.0...v2.9.0 [`6a9ef3f`](https://togithub.com/kubernetes/klog/commit/6a9ef3fa9a15) fix typo [`59f7cb5`](https://togithub.com/kubernetes/klog/commit/59f7cb505f58) fix byte array display in InfoS and ErrorS [`cf22f1e`](https://togithub.com/kubernetes/klog/commit/cf22f1e79721) Call logr with call depth [`e95c7e3`](https://togithub.com/kubernetes/klog/commit/e95c7e303755) make SetLogger thread-safe [`2728fe1`](https://togithub.com/kubernetes/klog/commit/2728fe192acc) check usage of format specifier in structured log func [`a18bc97`](https://togithub.com/kubernetes/klog/commit/a18bc976a212) Fix by pr suggestions [`4e4135c`](https://togithub.com/kubernetes/klog/commit/4e4135c3dd8a) Add check for InfoS & ErrorS parameters ### [`v2.8.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.8.0): Bug fixes for structured logging for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.7.0...v2.8.0) ### [`v2.7.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.7.0): Miscellaneous fixes for structured logging for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.6.0...v2.7.0) Changes are here : kubernetes/klog@v2.6.0...v2.7.0 ### [`v2.6.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.6.0): Adding a linter for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.5.0...v2.6.0) Changes are here : kubernetes/klog@v2.5.0...v2.6.0 please see https://github.com/kubernetes/klog/tree/master/hack/tools/logcheck ### [`v2.5.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.5.0): Prepare release for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.4.0...v2.5.0) Changes are here : kubernetes/klog@v2.4.0...v2.5.0 klog.go has new API: +func ErrorSDepth(depth int, err error, msg string, keysAndValues ...interface{}) { +func InfoSDepth(depth int, msg string, keysAndValues ...interface{}) { klogr/klogr.go has new API: func (l klogger) WithCallDepth(depth int) logr.Logger { func NewWithOptions(options ...Option) logr.Logger { func WithFormat(format Format) Option { ### [`v2.4.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.4.0): Prepare release for Kubernetes v1.20 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.3.0...v2.4.0) Changes are here : kubernetes/klog@v2.3.0...v2.4.0 ### [`v2.3.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.3.0): Fix Typo-ed Method Error -> ErrorS [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.2.0...v2.3.0) Changes are here : kubernetes/klog@v2.2.0...v2.3.0 ### [`v2.2.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.2.0): Dependency update and bugfix for InfoS [Compare Source](https://togithub.com/kubernetes/klog/compare/2.1.0...v2.2.0) - [`2e691eb`](https://togithub.com/kubernetes/klog/commit/2e691eb3eeb3) Fix missing fields in verbose InfoS - [`966c986`](https://togithub.com/kubernetes/klog/commit/966c98681ca0) feat use go-logr v0.2.0 Changes are here : kubernetes/klog@v2.1.0...v2.2.0 ### [`v2.1.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.1.0): Better support for Structured Logging [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.0.0...2.1.0) We are now enforcing API compatibility, added Windows based tests, and have tweaked the structured logging methods after some real world experience updating kubernetes main repo. - [`bbd9ca1`](https://togithub.com/kubernetes/klog/commit/bbd9ca1) Add tests for error in InfoS - [`1ccc0e1`](https://togithub.com/kubernetes/klog/commit/1ccc0e1) fix imported bug time encode format form kvlistFormat - [`dd4d1a6`](https://togithub.com/kubernetes/klog/commit/dd4d1a6) fix typo in README.md - [`49123d4`](https://togithub.com/kubernetes/klog/commit/49123d4) ErrorS(nil, ...) should call loggr.Error(nil, ...) - [`5b199cd`](https://togithub.com/kubernetes/klog/commit/5b199cd) Fix documentation for V(level) - [`d1eb30f`](https://togithub.com/kubernetes/klog/commit/d1eb30f) Add apidiff script to check go signature changes - [`dc505bf`](https://togithub.com/kubernetes/klog/commit/dc505bf) Switch slack channel to #klog - [`a47ebb9`](https://togithub.com/kubernetes/klog/commit/a47ebb9) Add example for co-existence of klog v1 and v2 - [`134f148`](https://togithub.com/kubernetes/klog/commit/134f148) logName(): lazily lookup userName instead of on init() - [`db06a1b`](https://togithub.com/kubernetes/klog/commit/db06a1b) fix serialization of special html chars - [`5727d2a`](https://togithub.com/kubernetes/klog/commit/5727d2a) Fix Windows integration tests - [`edbc1d3`](https://togithub.com/kubernetes/klog/commit/edbc1d3) test(\*): TestRollover failed randomly on Windows - [`6f99060`](https://togithub.com/kubernetes/klog/commit/6f99060) Add LogToStderr, a programatic way to log exclusively to stderr or not ### [`v2.0.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.0.0): Release to support Kubernetes v1.19 [Compare Source](https://togithub.com/kubernetes/klog/compare/v1.0.0...v2.0.0) Beware of type change: `Verbose` New Methods: - `SetLogger` (override logger to set a custom implementation) - `InfoS` (structured logging) - `ErrorS` (structured logging) Changes are here : kubernetes/klog@v2.0.0-rc.1...v2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com> Co-authored-by: Yang Song <songy23@users.noreply.github.com> Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [k8s.io/klog](https://togithub.com/kubernetes/klog) | require | major | `v1.0.0` -> `v2.110.1` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>kubernetes/klog (k8s.io/klog)</summary> ### [`v2.110.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.110.1): Prepare klog release for Kubernetes v1.29 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.100.1...v2.110.1) #### What's Changed - fix: SetLogger via klog.SetLogger will output an unexpected newline by [@&open-telemetry#8203;aimuz](https://togithub.com/aimuz) in [https://github.com/kubernetes/klog/pull/378](https://togithub.com/kubernetes/klog/pull/378) - resolve comments warning by [@&open-telemetry#8203;lowang-bh](https://togithub.com/lowang-bh) in [https://github.com/kubernetes/klog/pull/379](https://togithub.com/kubernetes/klog/pull/379) - stderrthreshold: fix flag comment by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/376](https://togithub.com/kubernetes/klog/pull/376) - enable "go vet" checks for parameters by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/390](https://togithub.com/kubernetes/klog/pull/390) - promote experimental code to stable by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/392](https://togithub.com/kubernetes/klog/pull/392) - golangci-lint action by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/380](https://togithub.com/kubernetes/klog/pull/380) - output: handle WithName like zapr does by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/391](https://togithub.com/kubernetes/klog/pull/391) - slog support + logr 1.3.0 update by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/384](https://togithub.com/kubernetes/klog/pull/384) #### New Contributors - [@&open-telemetry#8203;aimuz](https://togithub.com/aimuz) made their first contribution in [https://github.com/kubernetes/klog/pull/378](https://togithub.com/kubernetes/klog/pull/378) - [@&open-telemetry#8203;lowang-bh](https://togithub.com/lowang-bh) made their first contribution in [https://github.com/kubernetes/klog/pull/379](https://togithub.com/kubernetes/klog/pull/379) **Full Changelog**: kubernetes/klog@v2.100.1...v2.110.1 ### [`v2.100.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.100.1): Prepare klog release for Kubernetes v1.28 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.90.1...v2.100.1) #### What's Changed - expose logBridge via NewStandardLog() by [@&open-telemetry#8203;mikedanese](https://togithub.com/mikedanese) in [https://github.com/kubernetes/klog/pull/369](https://togithub.com/kubernetes/klog/pull/369) - add Format wrapper by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/374](https://togithub.com/kubernetes/klog/pull/374) - JSON as fallback encoding by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/375](https://togithub.com/kubernetes/klog/pull/375) #### New Contributors - [@&open-telemetry#8203;mikedanese](https://togithub.com/mikedanese) made their first contribution in [https://github.com/kubernetes/klog/pull/369](https://togithub.com/kubernetes/klog/pull/369) **Full Changelog**: kubernetes/klog@v2.90.1...v2.100.1 ### [`v2.90.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.90.1): Prepare klog release for Kubernetes v1.27 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.90.0...v2.90.1) #### What's Changed - buffer: restore dropping of too large buffers by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/366](https://togithub.com/kubernetes/klog/pull/366) - ktesting improvements by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/365](https://togithub.com/kubernetes/klog/pull/365) - ktesting + textlogger config api by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/368](https://togithub.com/kubernetes/klog/pull/368) - textlogger write through by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/363](https://togithub.com/kubernetes/klog/pull/363) **Full Changelog**: kubernetes/klog@v2.90.0...v2.90.1 ### [`v2.90.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.90.0): Prepare klog release for Kubernetes v1.27 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.80.1...v2.90.0) #### What's Changed - klog: benchmark the overhead when logging is off by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/355](https://togithub.com/kubernetes/klog/pull/355) - improve textlogger by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/362](https://togithub.com/kubernetes/klog/pull/362) **Full Changelog**: kubernetes/klog@v2.80.1...v2.90.0 ##### There are some API differences from previous version k8s.io/klog/v2/klogr contains incompatible changes: - klogger.Enabled: removed - klogger.Error: removed - klogger.Info: removed k8s.io/klog/v2/test contains incompatible changes: - InitKlog: changed from func() to func(testing.TB) *flag.FlagSet ### [`v2.80.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.80.1): Prepare klog release for Kubernetes v1.26 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.80.0...v2.80.1) #### What's Changed - InitFlags concurrency fix by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/349](https://togithub.com/kubernetes/klog/pull/349) **Full Changelog**: kubernetes/klog@v2.80.0...v2.80.1 ### [`v2.80.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.80.0): Prepare klog release for Kubernetes v1.26 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.70.1...v2.80.0) #### What's Changed - OWNERS: add harshanarayana by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/342](https://togithub.com/kubernetes/klog/pull/342) - kvlistformat: fix the issue with display marshalled value for non string type by [@&open-telemetry#8203;harshanarayana](https://togithub.com/harshanarayana) in [https://github.com/kubernetes/klog/pull/344](https://togithub.com/kubernetes/klog/pull/344) - Bump version of golang to 1.19 and drop older versions by [@&open-telemetry#8203;dims](https://togithub.com/dims) in [https://github.com/kubernetes/klog/pull/345](https://togithub.com/kubernetes/klog/pull/345) **Full Changelog**: kubernetes/klog@v2.70.1...v2.80.0 ### [`v2.70.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.70.1): Prepare klog release for Kubernetes v1.25 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.70.0...v2.70.1) #### What's Changed - ktesting: handle test completion by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/337](https://togithub.com/kubernetes/klog/pull/337) - contextual logging: enable by default again by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/341](https://togithub.com/kubernetes/klog/pull/341) **Full Changelog**: kubernetes/klog@v2.70.0...v2.70.1 ### [`v2.70.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.70.0): Prepare klog release for Kubernetes v1.25 (Take 1) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.60.1...v2.70.0) #### What's Changed - logcheck: contextual logging + enhanced checks by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/297](https://togithub.com/kubernetes/klog/pull/297) - hack/tools: drop dependency on golangci-lint by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/313](https://togithub.com/kubernetes/klog/pull/313) - StopFlushDaemon: document flushing on shutdown by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/314](https://togithub.com/kubernetes/klog/pull/314) - logcheck: fix detection of invalid \* regexp in filter by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/315](https://togithub.com/kubernetes/klog/pull/315) - README.md: clarify -logtostderr by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/319](https://togithub.com/kubernetes/klog/pull/319) - Trim duplicates by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/324](https://togithub.com/kubernetes/klog/pull/324) - replace KObjs with KObjSlice by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/322](https://togithub.com/kubernetes/klog/pull/322) - support logr.Marshaler by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/325](https://togithub.com/kubernetes/klog/pull/325) - internal: remove unused TrimDuplicates by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/326](https://togithub.com/kubernetes/klog/pull/326) - save and restore state by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/320](https://togithub.com/kubernetes/klog/pull/320) - GitHub: use apidiff with more recent Go by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/329](https://togithub.com/kubernetes/klog/pull/329) - remove hack/tools by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/330](https://togithub.com/kubernetes/klog/pull/330) - GIT-331: fix shadowing key from the kv pair by [@&open-telemetry#8203;harshanarayana](https://togithub.com/harshanarayana) in [https://github.com/kubernetes/klog/pull/332](https://togithub.com/kubernetes/klog/pull/332) - klog.Fatal backtrace revert by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/328](https://togithub.com/kubernetes/klog/pull/328) - ktesting: capture log data in memory by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/327](https://togithub.com/kubernetes/klog/pull/327) - GIT-275: add tests for int and struct keys by [@&open-telemetry#8203;harshanarayana](https://togithub.com/harshanarayana) in [https://github.com/kubernetes/klog/pull/333](https://togithub.com/kubernetes/klog/pull/333) #### New Contributors - [@&open-telemetry#8203;harshanarayana](https://togithub.com/harshanarayana) made their first contribution in [https://github.com/kubernetes/klog/pull/332](https://togithub.com/kubernetes/klog/pull/332) **Full Changelog**: kubernetes/klog@v2.60.1...v2.70.0 ### [`v2.60.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.60.1): Prepare klog release for Kubernetes v1.24 (Take 6) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.60.0...v2.60.1) #### What's Changed - Cleanup OWNERS file by [@&open-telemetry#8203;serathius](https://togithub.com/serathius) in [https://github.com/kubernetes/klog/pull/309](https://togithub.com/kubernetes/klog/pull/309) - dependencies: avoid k8s.io/utils, fork clock code instead by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/310](https://togithub.com/kubernetes/klog/pull/310) - promote contextual logging APIs to stable by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/311](https://togithub.com/kubernetes/klog/pull/311) **Full Changelog**: kubernetes/klog@v2.60.0...v2.60.1 ### [`v2.60.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.60.0): Prepare klog release for Kubernetes v1.24 (Take 5) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.50.2...v2.60.0) #### What's Changed - SetContextualLogger: remove unintentionally merged API call by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/308](https://togithub.com/kubernetes/klog/pull/308) **Full Changelog**: kubernetes/klog@v2.50.2...v2.60.0 ### [`v2.50.2`](https://togithub.com/kubernetes/klog/compare/v2.50.1...v2.50.2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.50.1...v2.50.2) ### [`v2.50.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.50.1): Prepare klog release for Kubernetes v1.24 (Take 4) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.50.0...v2.50.1) #### What's Changed - SetLoggerWithOptions: support flushing by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/306](https://togithub.com/kubernetes/klog/pull/306) **Full Changelog**: kubernetes/klog@v2.50.0...v2.50.1 ### [`v2.50.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.50.0): Prepare klog release for Kubernetes v1.24 (Take 3) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.40.1...v2.50.0) #### What's Changed - Panic on empty info with custom logr by [@&open-telemetry#8203;jklaw90](https://togithub.com/jklaw90) in [https://github.com/kubernetes/klog/pull/283](https://togithub.com/kubernetes/klog/pull/283) - Add missing Depth logging functions. by [@&open-telemetry#8203;s3rj1k](https://togithub.com/s3rj1k) in [https://github.com/kubernetes/klog/pull/280](https://togithub.com/kubernetes/klog/pull/280) - fix typo in klog.go by [@&open-telemetry#8203;cocaccola](https://togithub.com/cocaccola) in [https://github.com/kubernetes/klog/pull/270](https://togithub.com/kubernetes/klog/pull/270) - Update README.md by [@&open-telemetry#8203;noaabarki](https://togithub.com/noaabarki) in [https://github.com/kubernetes/klog/pull/281](https://togithub.com/kubernetes/klog/pull/281) - log filter: ignored by V, used during log call by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/290](https://togithub.com/kubernetes/klog/pull/290) - SetLogger/ClearLogger/SetLogFilter cleanup by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/289](https://togithub.com/kubernetes/klog/pull/289) - fixes for PR [#&open-telemetry#8203;280](https://togithub.com/kubernetes/klog/issues/280), refactoring, textlogger, unit test by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/287](https://togithub.com/kubernetes/klog/pull/287) - klogr verbosity by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/295](https://togithub.com/kubernetes/klog/pull/295) - test: fix Go version matrix by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/298](https://togithub.com/kubernetes/klog/pull/298) - handle panics in MarshalLog, Error, String by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/299](https://togithub.com/kubernetes/klog/pull/299) - Fix goroutine leak: make flushDaemon stoppable by [@&open-telemetry#8203;katexochen](https://togithub.com/katexochen) in [https://github.com/kubernetes/klog/pull/293](https://togithub.com/kubernetes/klog/pull/293) - structured logging: replacing Fatal/Exit/etc. without loss of flushing by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/303](https://togithub.com/kubernetes/klog/pull/303) - contextual logging by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/296](https://togithub.com/kubernetes/klog/pull/296) - remove side effects of tests by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/305](https://togithub.com/kubernetes/klog/pull/305) - tests: stop testing with Go 1.14 by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/304](https://togithub.com/kubernetes/klog/pull/304) #### New Contributors - [@&open-telemetry#8203;jklaw90](https://togithub.com/jklaw90) made their first contribution in [https://github.com/kubernetes/klog/pull/283](https://togithub.com/kubernetes/klog/pull/283) - [@&open-telemetry#8203;s3rj1k](https://togithub.com/s3rj1k) made their first contribution in [https://github.com/kubernetes/klog/pull/280](https://togithub.com/kubernetes/klog/pull/280) - [@&open-telemetry#8203;cocaccola](https://togithub.com/cocaccola) made their first contribution in [https://github.com/kubernetes/klog/pull/270](https://togithub.com/kubernetes/klog/pull/270) - [@&open-telemetry#8203;noaabarki](https://togithub.com/noaabarki) made their first contribution in [https://github.com/kubernetes/klog/pull/281](https://togithub.com/kubernetes/klog/pull/281) - [@&open-telemetry#8203;katexochen](https://togithub.com/katexochen) made their first contribution in [https://github.com/kubernetes/klog/pull/293](https://togithub.com/kubernetes/klog/pull/293) **Full Changelog**: kubernetes/klog@v2.40.1...v2.50.0 ### [`v2.40.1`](https://togithub.com/kubernetes/klog/releases/tag/v2.40.1): Prepare klog release for Kubernetes v1.24 (Take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.40.0...v2.40.1) #### What's Changed - Using OS targeted go files to separate out the username logic. by [@&open-telemetry#8203;phillipsj](https://togithub.com/phillipsj) in [https://github.com/kubernetes/klog/pull/271](https://togithub.com/kubernetes/klog/pull/271) - Recover from nil pointers when logging by [@&open-telemetry#8203;dims](https://togithub.com/dims) in [https://github.com/kubernetes/klog/pull/279](https://togithub.com/kubernetes/klog/pull/279) #### New Contributors - [@&open-telemetry#8203;phillipsj](https://togithub.com/phillipsj) made their first contribution in [https://github.com/kubernetes/klog/pull/271](https://togithub.com/kubernetes/klog/pull/271) **Full Changelog**: kubernetes/klog@v2.40.0...v2.40.1 ### [`v2.40.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.40.0): Prepare klog release for Kubernetes v1.24 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.30.0...v2.40.0) #### What's Changed - structured logging: support values with line breaks by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/273](https://togithub.com/kubernetes/klog/pull/273) - Fix klog lock release on panic error by [@&open-telemetry#8203;astraw99](https://togithub.com/astraw99) in [https://github.com/kubernetes/klog/pull/272](https://togithub.com/kubernetes/klog/pull/272) - add format test for KObjs by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/276](https://togithub.com/kubernetes/klog/pull/276) - add Verbose.InfoSDepth by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/277](https://togithub.com/kubernetes/klog/pull/277) #### Known Issues - [https://github.com/kubernetes/klog/issues/278](https://togithub.com/kubernetes/klog/issues/278) #### New Contributors - [@&open-telemetry#8203;astraw99](https://togithub.com/astraw99) made their first contribution in [https://github.com/kubernetes/klog/pull/272](https://togithub.com/kubernetes/klog/pull/272) **Full Changelog**: kubernetes/klog@v2.30.0...v2.40.0 ### [`v2.30.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.30.0): Prepare klog release for Kubernetes v1.23 (take 2) [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.20.0...v2.30.0) #### What's Changed - Fix logcheck exit function by [@&open-telemetry#8203;luyou86](https://togithub.com/luyou86) in [https://github.com/kubernetes/klog/pull/265](https://togithub.com/kubernetes/klog/pull/265) - custom marshaler for ObjectRef by [@&open-telemetry#8203;pohly](https://togithub.com/pohly) in [https://github.com/kubernetes/klog/pull/266](https://togithub.com/kubernetes/klog/pull/266) #### New Contributors - [@&open-telemetry#8203;luyou86](https://togithub.com/luyou86) made their first contribution in [https://github.com/kubernetes/klog/pull/265](https://togithub.com/kubernetes/klog/pull/265) **Full Changelog**: kubernetes/klog@v2.20.0...v2.30.0 ### [`v2.20.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.20.0): Prepare klog release for Kubernetes v1.23 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.10.0...v2.20.0) Changes are here : kubernetes/klog@v2.10.0...v2.20.0 since we moved to logr v1.0.0, there are incompatible changes: - klogger.Enabled: changed from func() bool to func(int) bool - klogger.Info: changed from func(string, ...interface{}) to func(int, string, ...interface{}) - klogger.V: removed - klogger.WithCallDepth: changed from func(int) github.com/go-logr/logr.Logger to func(int) github.com/go-logr/logr.LogSink - klogger.WithName: changed from func(string) github.com/go-logr/logr.Logger to func(string) github.com/go-logr/logr.LogSink - klogger.WithValues: changed from func(...interface{}) github.com/go-logr/logr.Logger to func(...interface{}) github.com/go-logr/logr.LogSink [`83653a6`](https://togithub.com/kubernetes/klog/commit/83653a6deebf) Update to newest versions of golang 1.17.x [`d648c2e`](https://togithub.com/kubernetes/klog/commit/d648c2e42d30) fix file-based filtering symbolization [`8ee3d65`](https://togithub.com/kubernetes/klog/commit/8ee3d652c96b) export ClearLogger [`4171f3c`](https://togithub.com/kubernetes/klog/commit/4171f3c1be1b) Switching to logr tag v1.0.0 [`9ab3c2b`](https://togithub.com/kubernetes/klog/commit/9ab3c2b56cb2) add serathius as approvers of klog ### [`v2.10.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.10.0): One more change to support 1.22 release [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.9.0...v2.10.0) Changes are here : kubernetes/klog@v2.9.0...v2.10.0 new function added: func KObjs(arg interface{}) []ObjectRef ### [`v2.9.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.9.0): Prepare release for Kubernetes v1.22 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.8.0...v2.9.0) Changes are here : kubernetes/klog@v2.8.0...v2.9.0 [`6a9ef3f`](https://togithub.com/kubernetes/klog/commit/6a9ef3fa9a15) fix typo [`59f7cb5`](https://togithub.com/kubernetes/klog/commit/59f7cb505f58) fix byte array display in InfoS and ErrorS [`cf22f1e`](https://togithub.com/kubernetes/klog/commit/cf22f1e79721) Call logr with call depth [`e95c7e3`](https://togithub.com/kubernetes/klog/commit/e95c7e303755) make SetLogger thread-safe [`2728fe1`](https://togithub.com/kubernetes/klog/commit/2728fe192acc) check usage of format specifier in structured log func [`a18bc97`](https://togithub.com/kubernetes/klog/commit/a18bc976a212) Fix by pr suggestions [`4e4135c`](https://togithub.com/kubernetes/klog/commit/4e4135c3dd8a) Add check for InfoS & ErrorS parameters ### [`v2.8.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.8.0): Bug fixes for structured logging for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.7.0...v2.8.0) ### [`v2.7.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.7.0): Miscellaneous fixes for structured logging for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.6.0...v2.7.0) Changes are here : kubernetes/klog@v2.6.0...v2.7.0 ### [`v2.6.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.6.0): Adding a linter for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.5.0...v2.6.0) Changes are here : kubernetes/klog@v2.5.0...v2.6.0 please see https://github.com/kubernetes/klog/tree/master/hack/tools/logcheck ### [`v2.5.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.5.0): Prepare release for Kubernetes v1.21 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.4.0...v2.5.0) Changes are here : kubernetes/klog@v2.4.0...v2.5.0 klog.go has new API: +func ErrorSDepth(depth int, err error, msg string, keysAndValues ...interface{}) { +func InfoSDepth(depth int, msg string, keysAndValues ...interface{}) { klogr/klogr.go has new API: func (l klogger) WithCallDepth(depth int) logr.Logger { func NewWithOptions(options ...Option) logr.Logger { func WithFormat(format Format) Option { ### [`v2.4.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.4.0): Prepare release for Kubernetes v1.20 [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.3.0...v2.4.0) Changes are here : kubernetes/klog@v2.3.0...v2.4.0 ### [`v2.3.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.3.0): Fix Typo-ed Method Error -> ErrorS [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.2.0...v2.3.0) Changes are here : kubernetes/klog@v2.2.0...v2.3.0 ### [`v2.2.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.2.0): Dependency update and bugfix for InfoS [Compare Source](https://togithub.com/kubernetes/klog/compare/2.1.0...v2.2.0) - [`2e691eb`](https://togithub.com/kubernetes/klog/commit/2e691eb3eeb3) Fix missing fields in verbose InfoS - [`966c986`](https://togithub.com/kubernetes/klog/commit/966c98681ca0) feat use go-logr v0.2.0 Changes are here : kubernetes/klog@v2.1.0...v2.2.0 ### [`v2.1.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.1.0): Better support for Structured Logging [Compare Source](https://togithub.com/kubernetes/klog/compare/v2.0.0...2.1.0) We are now enforcing API compatibility, added Windows based tests, and have tweaked the structured logging methods after some real world experience updating kubernetes main repo. - [`bbd9ca1`](https://togithub.com/kubernetes/klog/commit/bbd9ca1) Add tests for error in InfoS - [`1ccc0e1`](https://togithub.com/kubernetes/klog/commit/1ccc0e1) fix imported bug time encode format form kvlistFormat - [`dd4d1a6`](https://togithub.com/kubernetes/klog/commit/dd4d1a6) fix typo in README.md - [`49123d4`](https://togithub.com/kubernetes/klog/commit/49123d4) ErrorS(nil, ...) should call loggr.Error(nil, ...) - [`5b199cd`](https://togithub.com/kubernetes/klog/commit/5b199cd) Fix documentation for V(level) - [`d1eb30f`](https://togithub.com/kubernetes/klog/commit/d1eb30f) Add apidiff script to check go signature changes - [`dc505bf`](https://togithub.com/kubernetes/klog/commit/dc505bf) Switch slack channel to #klog - [`a47ebb9`](https://togithub.com/kubernetes/klog/commit/a47ebb9) Add example for co-existence of klog v1 and v2 - [`134f148`](https://togithub.com/kubernetes/klog/commit/134f148) logName(): lazily lookup userName instead of on init() - [`db06a1b`](https://togithub.com/kubernetes/klog/commit/db06a1b) fix serialization of special html chars - [`5727d2a`](https://togithub.com/kubernetes/klog/commit/5727d2a) Fix Windows integration tests - [`edbc1d3`](https://togithub.com/kubernetes/klog/commit/edbc1d3) test(\*): TestRollover failed randomly on Windows - [`6f99060`](https://togithub.com/kubernetes/klog/commit/6f99060) Add LogToStderr, a programatic way to log exclusively to stderr or not ### [`v2.0.0`](https://togithub.com/kubernetes/klog/releases/tag/v2.0.0): Release to support Kubernetes v1.19 [Compare Source](https://togithub.com/kubernetes/klog/compare/v1.0.0...v2.0.0) Beware of type change: `Verbose` New Methods: - `SetLogger` (override logger to set a custom implementation) - `InfoS` (structured logging) - `ErrorS` (structured logging) Changes are here : kubernetes/klog@v2.0.0-rc.1...v2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com> Co-authored-by: Yang Song <songy23@users.noreply.github.com> Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
What this PR does / why we need it:
The initial structured logging output (almost) always produced a single line
per log message, with quoting of strings to represent line breaks as \n. This
made the output hard to read (see
kubernetes/kubernetes#104868).
It was still possible to get line breaks when formatting a value with
%+v
andthat ended up emitting line breaks; this was probably not intended.
Now string values are only quoted if they contain no line break. If they do,
start/end markers delimit the text which appears on its own lines, with
indention to ensure that those additional lines are not accidentally treated as
a new log message when they happen to contain the klog header. It also makes
the output more readable.
The result of
fmt.Sprintf("%+v")
is printed verbatim without quoting when itcontains no line break, otherwise as multi-line value with delimiter and
indention.
Traditional output:
Old InfoS output before this commit:
New InfoS output:
Which issue(s) this PR fixes:
Fixes kubernetes/kubernetes#106262, kubernetes/kubernetes#106428
Special notes for your reviewer:
kubernetes/kubernetes#106262, kubernetes/kubernetes#106428
Compared to PR #268, the format changes in this PR are smaller: the main message is still printed as before (quoted string). Only special string values are formatted differently.
The PR also contains some performance improvements in the original implementation. The initial set of commits could be merged without the format change. See commit messages for benchmark results of each individual change.
Release note: