Writing content to a media
To manage the complexity of code isolation, let's declare a C# interface which will manage the idiosyncrasies of multiple log targets:
public interface IContentWriter { Task<bool> Write(string content); }
The basic idea here, is that the concrete classes which implement the interface should provide an implementation of this method that writes the log to the respective media. But on closer inspection, we find that it is better to write a base class implementation of this method and its associated semantics in an abstract class. The base class implementation can add a log entry to a queue (that would give concurrency support), flush the queue, and persist to target the media when a threshold (configured) is reached. A method will be marked as abstract which will provide a mechanism for concrete classes to write entries for the respective media.
Since our library is supposed to work in a multi-threaded environment, we...