Sascha-L / WPF-MediaKit

Microsoft Public License
366 stars 116 forks source link

Configurable logging #51

Closed xmedeko closed 7 years ago

xmedeko commented 7 years ago

I would like to have some configurable logging, e.g. to log used video filters, errors, etc. One possibility is to have a simple interface like:

public interface ILogger
{
    void Log(LogLevel level, string message, Exception exception - null);
    bool IsEnabled(LogLevel level);
}

And a user may provide it's own implementation. Default implementation would be set to System.Diagnostics.Trace.

Or to use LibLog, which has similar approach, and (but) it has autoconfiguration for the most common logging frameworks. So, it's not a backward 100% compatible change because is may start to log automatically for some users. (I think most of them will be happy with that.) Of course, it is possible to switch it off.

Note, IMO Common.Logging is to heavy and not necessary.

@Sascha-L any thoughts?

xmedeko commented 7 years ago

No comments, so I have decided to try the custom ILog interface to avoid LibLog reflections.