コード例 #1
0
        public void TestOutput(LogLevel outputLevel)
        {
            var sink1  = Logs.Capture();
            var sink2  = Logs.Capture();
            var logger = Logs.ToMultiple(sink1, sink2).Logger("");

            WriteTestMessages(logger, outputLevel);
            LogCaptureTest.VerifyCapturedOutput(outputLevel, LogLevel.Debug, "", sink1);
            LogCaptureTest.VerifyCapturedOutput(outputLevel, LogLevel.Debug, "", sink2);
        }
コード例 #2
0
        public void TestOutput(LogLevel outputLevel, LogLevel enableLevel)
        {
            var capture = Logs.Capture();
            var logger  = capture.Level(enableLevel).Logger("logname");

            Assert.True(logger.IsEnabled(enableLevel));
            if (enableLevel > LogLevel.Debug)
            {
                Assert.False(logger.IsEnabled(enableLevel - 1));
            }
            WriteTestMessages(logger, outputLevel);
            LogCaptureTest.VerifyCapturedOutput(outputLevel, enableLevel, "logname", capture);
        }