internal ConsoleTarget(ConsoleTargetBuilder builder) { this.pattern = ParsedLayout.Parse(builder.Layout, builder.LayoutMode); this.Layout = builder.Layout; this.LayoutMode = builder.LayoutMode; this.colorMappings.AddMany(builder.ColorMappings); this.colorMappings.MakeReadOnly(); this.colorMappingsCache = this.colorMappings.GetEffectiveColors(); this.console = new BclConsoleWrapper(); }
public void Capturing_should_allow_customization_of_output_data_not_specified() { var target = new ConsoleTargetBuilder { Layout = "{Time}" }.Build(); DefaultLogger logger = new DefaultLogger(null, target); var evt = new MyEvent(); logger.Info(evt); Assert.Equal(0, evt.Count); }
public void Capturing_should_allow_customization_of_output_data() { var target = new ConsoleTargetBuilder { Layout = "{Time} {Data}" }.Build(); // Because {Data} is present DefaultLogger logger = new DefaultLogger(null, target); var evt = new MyEvent(); logger.Info(evt); Assert.Equal(1, evt.Count); }