Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there. Thank you for this library, it's allowing me to create custom logr sinks quite easily.
I noticed that the LogSink supports arbitrary call depth through the WithCallerDepth function. This seems to be in line with the logr.CallDepthLogSink except that the naming is different. This PR fixes that naming and makes the LogSink adhere to the logr.CallDepthLogSink interface. This will allow logr.Logger to leverage this functionality: https://github.com/go-logr/logr/blob/master/logr.go#L336
I also noticed a duplicated type check. I replaced one of those with a new check for logr.CallDepthLogSink.
To be able to test the WithCallDepth function I replaced the logr.Logger type in caller_test.go with a small interface.