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

RollingInterval more extendable #225

Closed
blowin opened this issue Jun 17, 2021 · 1 comment
Closed

RollingInterval more extendable #225

blowin opened this issue Jun 17, 2021 · 1 comment

Comments

@blowin
Copy link

blowin commented Jun 17, 2021

Replace enum with class, and replace extension with method. This will allow you to more flexibly customize the spacing and format.

In my project, I need to use files with a specific name, but the library does not allow me to specify this. Therefore, I had to abandon this library and use a self-written solution.

I suggest the following solution:

public interface IRollingInterval
{
   string Format { get; }

   DateTime? CurrentCheckpoint(DateTime instant);

   DateTime? NextCheckpoint(DateTime instant);
}

With implementation: InfiniteRollingInterval, YearRollingInterval etc

This solution allow easy extend behaviour. To avoid backward compatibility issues, you can make a separate interface overload and mark the enum as obsolete.

blowin added a commit to blowin/serilog-sinks-file that referenced this issue Jun 20, 2021
@bartelink bartelink closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
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

No branches or pull requests

2 participants