-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Replace kit/log with log #1173
Replace kit/log with log #1173
Conversation
Seems good to me, given deprecation is what we want to go with. I think Peter had different ideas. Wild idea: would it make sense to create a Logger interface in each package where it is imported to decouple them from the log package. |
// wrap it with level.NewFilter. | ||
// Package level implements leveled logging on top of Go kit's log package. | ||
// | ||
// Deprecated: Use github.com/go-kit/log/level instead. |
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.
Maybe worth a little note here indicating our intent re: compatibility?
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.
Sure, happy to do that, but I'm not sure I know what the consensus is on that topic. Would you mind sharing your thoughts in more detail?
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.
Hmm, yeah, there are lots of unknowns re: the impact of removing this package from the kit module altogether. Let's defer for now.
I had it in my head that they should be separate packages. I can't recall a precise technical reason why this was a good idea. And I've encountered more than one situation, now, where it's been rather annoying that go-kit/kit/log wasn't an alias for, or equivalent to, or etc. go-kit/log. So I'm basically +1. What things do we need to be careful about? |
I intentionally left behind the example tests in the gutted packages for two reasons. First, to maintain their role as documentation, and second to serve as a small test that the APIs still work as before. We should be triply sure that I didn't accidentally cross any wires on any of the forward references. Make sure I didn't alias the wrong type, variable, function, or constant anywhere. One good sign: With a local I have some projects that use |
That would certainly decouple them more than they are today. I'm not sure it's a good idea, but I am not completely opposed. If we did that I would expect the docs for the new declarations to be a copy/paste of the existing |
My initial reaction was -1, but upon reflection I'm less negative. In any case we can defer this til later. |
@ChrisHines I'll check all the module/package import references carefully, but assuming that's kosher, you're OK with merging, is that right? |
Correct. |
As an additional datapoint I used a replace directive to bring this branch into a project I have that uses |
Some of the imports within go-kit/kit/log, for example in the tests, are still pointing to go-kit/kit/log —
Is that deliberate? |
Yes. |
OK! I'll merge this tomorrow unless there's an objection. |
Note that this breaks |
Thanks for pointing that out. Feel free to submit a PR (if you want) to update |
There is no single value that works for |
Could we revert just the DefaultCaller definition away from the current alias and back to a definition in terms of a Caller? |
If someone used purely |
My thinking is that, even if a program imported both the old and new module, a given Would this patch (or something like it) to this repo be insufficient? - DefaultCaller = log.DefaultCaller
+ DefaultCaller = Caller(3) (It is entirely possible that I am being dense.) |
Ah, maybe you're saying there's interplay with the normal usage via |
In my version of normal usage, there would be one |
Perhaps we can start with a test that reproduces the problem. |
I'm sorry, I was completely wrong. |
I'm sorry you had a scare, but I am very happy this turns out to be a non-issues. Thanks for following up. |
This includes go-jira v1.15.1 supporting Personal Access Tokens (PATs). Update go-kit imports due to: go-kit/kit#1173 Signed-off-by: Pierre Riteau <pierre@stackhpc.com>
This includes go-jira v1.15.1 supporting Personal Access Tokens (PATs). Update go-kit imports due to: go-kit/kit#1173 Signed-off-by: Pierre Riteau <pierre@stackhpc.com>
This includes go-jira v1.15.1 supporting Personal Access Tokens (PATs). Update go-jira imports [1] and go-kit imports [2]. [1] andygrunwald/go-jira#428 [2] go-kit/kit#1173 Signed-off-by: Pierre Riteau <pierre@stackhpc.com>
The kit/log packages that were copied to their own module become aliases for the new packages to avoid breaking existing code.
This change may also help projects that end up with dependencies using both import paths. They can use the types from the two paths interchangably and will only have one copy of the actual implementations compiled in to them.
Also change all the other Go kit packages to use the new log packages directly.