BedeGaming / sinks-rollingfile

A serilog sink for rolling files based on size and time
Apache License 2.0
15 stars 20 forks source link

Cross platform #10

Closed dazinator closed 5 years ago

dazinator commented 9 years ago

Have refactored for cross platform support.

  1. Converted the original project to a PCL project - named it "Serilog.Sinks.RollingFileAlternate.Portable"
  2. The .NET 4.5 project remains but now only contains a couple of classes that are .NET 4.5 specific. This is basically FileAccess class - and the Extensions methods (for the Fluent Syntax)

The idea behind this is it now becomes very easy to add support for other platforms within this solution.

The next phase of this PR (which I am happy to proceed with if desired) would be to add MonoDroid support by:

  1. Adding the platform specific project (i.e monodroid)
  2. In the new monodroid project add a reference to "Serilog.Sinks.RollingFileAlternate.Portable"
  3. Create an IFileSystem implementation to provide the filesystem operations for the target platform (monodroid).
  4. Create the Extension methods that defer to the extension methods already defined in "Serilog.Sinks.RollingFileAlternate.Portable" but pass in the droid specific IFileSystem instance for convenience.
  5. Ensure the NuGet package produced contains the Android assemly as well as the .NET 4.5 one.

This PR closes BedeGaming/sinks-rollingfile#9

dazinator commented 5 years ago

Closing this because PCL was eventually replaced by NETSTANDARD. If only I could have seen that far into the future.