-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use proposed new zerolog function to fix breakage #6
Conversation
There is now a PR on |
I just pushed my latest version of this PR which runs against a local clone of |
…5 is merged into zerolog
PR #575 has been merged. I've tested this branch against the specific commit from that merge and it continues to work fine. This PR is now passing, but only because it's using the unreleased commit. I would suggest letting this PR rest until the next |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 148 148
=========================================
Hits 148 148 ☔ View full report in Codecov by Sentry. |
Time to merge this in? |
FYI: I just had to block |
Hi @madkins23 sorry for the long delay. I've been quite busy, and your PRs completely went out of my radar after. It's merged now. Thank you very much for your work |
This is a proposed fix for the
rs/zerolog v1.32.0
breakage. It depends on a change to thers/zerolog
code that I have yet to file, the addition of a single function:More detail
My previous PR used
zerolog.Logger.With
to generate a newzerolog.Context
object because there was no other way to generate one with a specific logger. This would be replaced byNewContextWithResetLogger
. In addition, in my previous PR I had to plumb a "root" logger through so that theWith
method wouldn't generate a context with predefined fields. In this case the first line ofNewContextWithResetLogger
replaces any predefined fields with a single{
character viaenc.AppendBeginMarke
).Next Steps
If we're both satisfied with this I can file a PR on
rs/zerolog
to createNewContextWithResetLogger
(or something like that). I also wanted to have this PR ready so that I can refer to it when I file that PR.In the meantime, if you want to test this:
git clone
both (examples usessh
):madkins23/zerolog
git clone -b fix-zerolog git@github.com:madkins23/zerolog
madkins23/zeroslog
git clone -b fix-zerolog git@github.com:madkins23/zeroslog
github.com/madkins23/zeroslog/go.mod
:replace
line change the path to my clone ofmadkins23/zerolog
to the location of your clone of that repository in step 1.
go test ./...
in themadkins/zeroslog
clone directory.If you want to verify that you're using the right version of
zerolog
you can edit filegit.luolix.top/madkins23/ctx.go
and add afmt.Println
to the beginning of theinit
function.I've also used a similar mechanism to pull all of this into my benchmark/verification test harness, which has a bunch of specific tests. No errors there either.
As a side note, I'm mortified that I didn't now how to use the
replace
line ingo.mod
until now. Would have saved me some amount of work over the last few years. 😞