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

multi: add zstd support #1

Closed
wants to merge 1 commit into from
Closed

multi: add zstd support #1

wants to merge 1 commit into from

Conversation

jharveyb
Copy link

ZSTD is both faster and compresses at higher ratios than gzip, so it would be useful to have it as an option when rotating logs.

Further pro-ZSTD arguments here:

golang/go#62513

@jharveyb
Copy link
Author

Closed in favor of #2 , with go.mod fixes - I didn't see a way to change the PR branch here.

@jharveyb jharveyb closed this Aug 15, 2024
@jrick
Copy link
Owner

jrick commented Aug 15, 2024

I'm going to experiment with a different API, something like:

func (r *Rotator) SetCompressor(newCompressor func() io.WriteCloser, suffix string) {

It'll still default to gzip, but you should be able to pass in whatever other compressor and file suffix you want, and it won't pull in any additional dependencies that would otherwise go unused.

If/when zstd is added to the standard library, we can add a convenience method that calls it with the proper arguments to use zstd.

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.

2 participants