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

Add extension method to chain FileLifecycleHooks together #141

Merged
merged 15 commits into from
Apr 20, 2020

Conversation

EamonHetherton
Copy link
Contributor

Allows composing of FileLifecycleHooks e.g. Add FileHeaders and GZip the logs, or compress then encrypt.

@nblumhardt
Copy link
Member

Looks good; since FileLifecycleHooks is defined in this assembly, it could be implemented as an instance method rather than an extension?

Since there's a strong concept of ordering between chained hooks, perhaps we could use a name like Then() or something along those lines?

var hooks = new GZipHooks().Then(new HeaderWriter("File Header"));

@EamonHetherton
Copy link
Contributor Author

yeah, agree on both. Was never happy with "ChainTo" :)

And it is an extension as it started life in my own project, but makes sense as an instance.

will update...

@nblumhardt nblumhardt merged commit 7106445 into serilog:dev Apr 20, 2020
@nblumhardt
Copy link
Member

LGTM! 👍

@nblumhardt nblumhardt mentioned this pull request Jun 22, 2021
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