public void ShouldLogInfo() { var boltWriter = Substitute.For<IBoltWriter>(); var subjectUnderTest = new StormBoltAppender(boltWriter); subjectUnderTest.DoAppend(new LoggingEvent(ErrorLog())); boltWriter.ReceivedWithAnyArgs().LogError(""); boltWriter.DidNotReceive().LogInfo(""); }
public static void UsingWriter(IBoltWriter writer) { var hierarchy = (Hierarchy)LogManager.GetRepository(); var layout = new PatternLayout("%date %-5level %logger - %message"); layout.ActivateOptions(); var boltAppender = new StormBoltAppender(writer) {Layout = layout}; boltAppender.ActivateOptions(); hierarchy.Root.AddAppender(boltAppender); hierarchy.Root.Level = Level.Info; hierarchy.Configured = true; }
public static void UsingWriter(IBoltWriter writer) { var hierarchy = (Hierarchy)LogManager.GetRepository(); var layout = new PatternLayout("%date %-5level %logger - %message"); layout.ActivateOptions(); var boltAppender = new StormBoltAppender(writer) { Layout = layout }; boltAppender.ActivateOptions(); hierarchy.Root.AddAppender(boltAppender); hierarchy.Root.Level = Level.Info; hierarchy.Configured = true; }