Beispiel #1
0
        public void TestMethod1()
        {
            var logExecuter = new LogFactory(new Loglog("hhh.txt")).CreateLogWriter();

            ILoggerClient logger  = logExecuter.GetLoggerClient();
            var           result1 = logger.Info("sdfsfdf");
            var           result2 = logger.Warning("sdbhfh");

            logger.Warning("sdbhfh");
            logger.Warning("sdbhfh");
            logger.Warning("sdbhfh");
            logger.Warning("sdbhfh");
            int i = 0;

            while (i < 20000)
            {
                logger.Warning("hgjghjhj");
                i++;
            }


            var result3 = logger.Warning("hgjghjhj");

            Thread.Sleep(3000);
            Assert.IsTrue(result1);
            Assert.IsTrue(result2);
            Assert.IsTrue(result3);
        }
Beispiel #2
0
        public void Method2()
        {
            ILoggerClient logger = LogManager.GetCurrentLogInstance();
            int           i      = 0;

            while (i < 200000)
            {
                logger.Info("abrakadabra");
                i++;
            }
            System.Threading.Thread.Sleep(7000);
            var result = File.Exists(@"C:\Users\Eric\source\repos\log2log\log2log.Tests\LogFile.txt");

            Assert.IsTrue(result);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            ILoggerClient logger = LogManager.GetCurrentLogInstance();


            for (int i = 0; i < 100; i++)
            {
                logger.Info("abrakadabra");
            }
            Thread.Sleep(TimeSpan.FromSeconds(4));



            Console.Read();
        }