Beispiel #1
0
        private static void Main(string[] args)
        {
            using (var logger = new LoggerClass("MyLogs", new TraceDestination() { AutoCommit = true, WriteConsole = true }))
            {

                var bll = new MyDriver(logger);

                bll.Run();
            }
        }
Beispiel #2
0
        public object Clone()
        {
            var logger = new LoggerClass
            {
                Categories   = Categories.ToList(),
                InstanceId   = InstanceId,
                Destinations = Destinations.ToList()
            };

            return(logger);
        }
Beispiel #3
0
        public void CommitTest()
        {
            using (var logger = new LoggerClass("TraceDestinationTests", new TraceDestination()
            {
                AutoCommit = false,
                Level = (int)EventSeverity.Verbose,
                WriteTrace = true
            }))
            {

                logger.NotifyInformation("Information");

                logger.CommitLog();

                Assert.IsNull(logger.Destinations.FirstOrDefault(i => i.LogList.Count > 0));

            }
        }
Beispiel #4
0
        public void LogTest()
        {
            var destination = new TraceDestination()
            {
                AutoCommit = false,
                Level = (int)EventSeverity.Verbose,
                WriteTrace = true
            };

            using (var logger = new LoggerClass("TraceDestinationTests"))
            {
                logger.Destinations.Add(destination);

                logger.NotifyInformation("Information");

                logger.Notify((int)EventSeverity.Verbose - 1, () => { return "Not be logged"; });

                int count = destination.LogList.Count;

                Assert.AreEqual(1, count);
            }
        }
Beispiel #5
0
        public object Clone()
        {
            var logger = new LoggerClass
            {
                Categories = Categories.ToList(),
                InstanceId = InstanceId,
                Destinations = Destinations.ToList()
            };

            return logger;
        }