Exemplo n.º 1
0
        public static LogManager ConfigureForTextWriter(StringWriter tw)
        {
            var twTarg = TextWriter.Create(Formatting.StringFormatter.LevelDatetimeMessagePathNl,
                                           tw, tw, false, LogLevel.Error, "tw");
            var twRule = RuleModule.Create(new Regex(@"^Intelliplan\.Logary\.Specs"),
                                           "tw", l => true, m => true, LogLevel.Verbose);

            var internalTarg = Console.Create("cons", Console.empty);

            return(Config.Configure(
                       "Logary Specs C# low level API",
                       new[] { twTarg },
                       Duration.FromSeconds(4L),
                       new Metric.MetricConf[0],
                       new[] { twRule },
                       LogLevel.Verbose, internalTarg));
        }
Exemplo n.º 2
0
        public static LogManager ConfigureForTextWriter(StringWriter tw)
        {
            var twTarg =
                TextWriter.Create(
                    TextWriter.TextWriterConf.Create(tw, tw,
                                                     new Microsoft.FSharp.Core.FSharpOption <MessageWriter>(MessageWriterModule.levelDatetimeMessagePathNewLine)),
                    "tw");

            var config = Config.create("Logary.CSharp.Tests C# low level API", "localhost");

            config = Config.ilogger(ILogger.NewConsole(LogLevel.Warn), config);
            config = Config.target(twTarg, config);
            config = Config.loggerMinLevel(".*", LogLevel.Verbose, config);
            var logary = Config.build(config).ToTask().Result;

            return(logary);
        }
Exemplo n.º 3
0
        public static LogManager ConfigureForTextWriter(StringWriter tw)
        {
            var twTarg =
                TextWriter.Create(
                    TextWriter.TextWriterConf.Create(tw, tw,
                                                     new Microsoft.FSharp.Core.FSharpOption <Formatting.StringFormatter>(Formatting.StringFormatterModule.levelDatetimeMessagePathNl)),
                    PointNameModule.OfSingle("tw"));
            var twRule =
                RuleModule.Create(new Regex(@"^Logary\.Specs"), PointNameModule.Parse("tw"), LogLevel.Verbose,
                                  message => true);

            var internalTarg = Console.Create(Console.empty, PointNameModule.Parse("console"));

            return(Config.Configure(
                       "Logary Specs C# low level API",
                       new[] { twTarg },
                       new Metric.MetricConf[0],
                       new[] { twRule },
                       LogLevel.Verbose, internalTarg)
                   .ToTask()
                   .Result);
        }