-
Notifications
You must be signed in to change notification settings - Fork 122
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
Preparations for https://github.com/serilog/serilog-sinks-rollingfile… #26
Conversation
Hi Vadym, thanks for kicking it off! I'm in general agreement about downcasting, but there's a trade-off in this instance. Adding small interfaces can be done without breaking changes, whereas once we've created an (The first version of So, I think while I'm okay with I can take care of project.json, no need to worry about that bit 👍 |
Yep, we should find a compromise between what interfaces/methods should be included in |
Thanks for the follow-up. Just looping back,
Do you think we'll avoid any issues other than downcasting? If not, the multiple-small-interface approach is probably preferable, given the nicer evolutionary path it enables. |
We will avoid a lot of |
Thanks for the follow-up. The more I think about this, the more I feel like the existence of multiple implementations should be wrapped up in the file sink and not a concern for consuming code. What do you think about turning
Unlike the interface option, future methods/properties could be added to a It would be more work than adding a new interface, but might set us up better in the long run... Impressions? |
Yep, it's fine for me also. Should i do it? Or you? |
@hmvs I'm fine either way - it would be great if you have the time to give it a shot. (Sorry about the slow turnaround, really needed to think about this one!) |
I just thought to implement it, but found that now we have two different SharedFileSinks and they are quite different. And if we merge them both to our FileSink it will be quite big and a lot of #if statements. And seems we do not have UT for specific cases how to verify that ATOMIC_APPEND and OS_MUTEX are not broken. |
Vadym, thanks for your work on this! Even though it's not possible to merge this directly now, working through it with you greatly clarified the direction we needed to take. I hope the new package structure lowers the friction of contributing in future - if you see more improvements that can be made after #35 please do jump in :-) All the best! |
It's preparation for serilog/serilog-sinks-rollingfile#33
Is there any reason why
PeriodicFlushToDiskSink
usesILogEventSink
as a parameter for the constructor? I propose to not do downcasting. Do we have some file-based sync that can't be flushed in one way or another?I believe we should make an interface
IFileSink
that will be inherited from bothISizeLimitedFileSink
,IFlushableFileSink
.Will do it in next commit if you agree.
And should i bump version in project.json?