Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //obviously not thread safe and lots of other things. But this illustrates the point that
- //Dispatcher can be stubbed and tested against to ensure a log entry was made.
- public static class Logger
- {
- public static ILoggerDispatcher Dispatcher { get; set; }
- public static void Log(string message, Exception exception)
- {
- if (Dispatcher != null)
- {
- Dispatcher.Log(message, exception);
- }
- }
- public static void Log(LogLevel level, string message)
- {
- if (Dispatcher != null)
- {
- Dispatcher.Log(message);
- }
- }
- }
Add Comment
Please, Sign In to add comment