コード例 #1
0
        public void Timestamp()
        {
            var definition = new FluentPatternLayoutDefinition();

            var child  = definition.Timestamp();
            var layout = (PatternLayout)((ILayoutDefinition)definition).CreateLayout();

            Assert.That(layout.ConversionPattern, Is.EqualTo("%timestamp"));
        }
コード例 #2
0
        public void ComplexPattern()
        {
            var definition = new FluentPatternLayoutDefinition();

            definition
            .Timestamp().RightJustified().MaximumWidth(10)
            .Space()
            .Level().LeftJustified().MinimumWidth(5)
            .Space()
            .Literal("[").Thread().Literal("]:")
            .Space()
            .Message().NewLine();

            var layout = (PatternLayout)((ILayoutDefinition)definition).CreateLayout();

            Assert.That(layout.ConversionPattern, Is.EqualTo("%.10timestamp %-5level [%thread]: %message%newline"));
        }