public void LoggingToManagerWithNoLoggersDoesNotFail() { var mgr = new LogCompositor(); mgr.LogMessage("", LogLevel.Verbose, "Log message"); mgr.LogException("", LogLevel.Error, "Log exception", new Exception()); }
public void LoggingManagerCallsOnLogCallbacks() { var mgr = new LogCompositor(); mgr.AddLoggingProvider(typeof(PluginLogger1)); Assert.AreEqual(1, mgr.Loggers.Count); mgr.LogMessage("", LogLevel.Verbose, "Log message"); mgr.LogException("", LogLevel.Error, "Log exception", new Exception()); var plugin = (PluginLogger1)mgr.Loggers.First(); Assert.AreEqual(1, plugin.LogMessageCallCount); Assert.AreEqual(1, plugin.LogExceptionCallCount); }