Skip to content
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 structured log for syncer #3

Merged
merged 1 commit into from
Jan 17, 2024
Merged

Use structured log for syncer #3

merged 1 commit into from
Jan 17, 2024

Conversation

n8maninger
Copy link
Member

No description provided.

@n8maninger n8maninger marked this pull request as ready for review January 13, 2024 02:06
@n8maninger n8maninger mentioned this pull request Jan 13, 2024
@lukechampine
Copy link
Member

You know, the original version of the Syncer took a Logger interface. I ended up removing it because it felt redundant. But this makes me want to put it back in. Coupling the Syncer to some third-party dependency feels sinful.

Has anyone looked at https://pkg.go.dev/log/slog yet? It was added in 1.21.

@n8maninger
Copy link
Member Author

n8maninger commented Jan 13, 2024

I'm most familiar with Zap, but I wouldn't mind migrating everything to slog as long as we're consistent. I looked at slog when it was announced, but Zap's API and output configuration are better. I think it allocates less too.

Coupling the Syncer to some third-party dependency feels sinful.

"lukechampine.com/frand" 👀 😛

@lukechampine
Copy link
Member

funny you mention that -- Go 1.22 has a new CSPRNG that will make frand obsolete: https://github.com/C2SP/C2SP/blob/main/chacha8rand.md

I am slightly sad about it (since I am proud of frand) but overall it will be nice to have a proper CSPRNG in the stdlib. And the design has a lot of overlap with frand, so I'll view it as a spiritual successor :P

@n8maninger n8maninger merged commit 6d84936 into master Jan 17, 2024
6 checks passed
@n8maninger n8maninger deleted the nate/syncer-use-zap branch January 17, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants