コード例 #1
0
        public void Test()
        {
            NLog.Config.SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Trace);

            var loggerFactory = new NLogLoggerFactory();

            var log = loggerFactory.GetLogger("Test");

            Assert.IsInstanceOf <NLogLogger>(log);

            CallAllMethodsOnLog(log);

            log = loggerFactory.GetLogger(typeof(LoggerFactoryTests));

            CallAllMethodsOnLog(log);
        }
コード例 #2
0
        public void Test()
        {
            NLog.Config.SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Trace);

            var loggerFactory = new NLogLoggerFactory();

            var log = loggerFactory.GetLogger("Test");

            Assert.IsInstanceOf<NLogLogger>(log);

            CallAllMethodsOnLog(log);

            log = loggerFactory.GetLogger(typeof(LoggerFactoryTests));

            CallAllMethodsOnLog(log);
        }
コード例 #3
0
        public void CanCreateLoggerFromNameWithLoggerFactory()
        {
            var loggerFactory = new NLogLoggerFactory();

            var logger = loggerFactory.GetLogger("logger name");

            Assert.NotNull(logger);
            Assert.AreEqual("logger name", logger.Name);
        }
コード例 #4
0
        public void CanCreateLoggerFromTypeWithLoggerFactory()
        {
            var loggerFactory = new NLogLoggerFactory();

            var logger = loggerFactory.GetLogger(GetType());

            Assert.NotNull(logger);
            Assert.AreEqual(GetType().FullName, logger.Name);
        }
コード例 #5
0
        public void CanCreateLoggerFromCurrentInstanceWithLogger()
        {
            var loggerFactory = new NLogLoggerFactory();
            var testLogger    = loggerFactory.GetLogger("TestLogger");

            var logger = testLogger.GetCurrentInstanceLogger();

            Assert.NotNull(logger);
            Assert.AreEqual(GetType().FullName, logger.Name);
        }