public SemanticLogAdapterTests() { channels.Add(channel.Object); channel.Setup(x => x.Log(It.IsAny <SemanticLogLevel>(), It.IsAny <string>())).Callback( new Action <SemanticLogLevel, string>((level, message) => { output = message; })); log = new Lazy <SemanticLog>(() => new SemanticLog(channels, new List <ILogAppender>(), () => new JsonLogWriter())); sut = new SemanticLogLoggerProvider(log.Value); }
public SemanticLogAdapterTests() { channels.Add(channel); A.CallTo(() => channel.Log(A <SemanticLogLevel> .Ignored, A <string> .Ignored)) .Invokes((SemanticLogLevel level, string message) => { output = message; }); log = new Lazy <SemanticLog>(() => new SemanticLog(channels, new List <ILogAppender>(), () => new JsonLogWriter())); sut = new SemanticLogLoggerProvider(log.Value); }
public SemanticLogAdapterTests() { options.Value.Level = SemanticLogLevel.Trace; channels.Add(channel); A.CallTo(() => channel.Log(A <SemanticLogLevel> ._, A <string> ._)) .Invokes((SemanticLogLevel level, string message) => { output = message; }); log = new Lazy <SemanticLog>(() => new SemanticLog(options, channels, new List <ILogAppender>(), JsonLogWriterFactory.Default())); sut = SemanticLogLoggerProvider.ForTesting(log.Value); }
public void Should_provide_null_logger_when_no_log_provided() { var provider = SemanticLogLoggerProvider.ForTesting(null); Assert.Same(provider.CreateLogger("test"), NullLogger.Instance); }