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(); } }
public object Clone() { var logger = new LoggerClass { Categories = Categories.ToList(), InstanceId = InstanceId, Destinations = Destinations.ToList() }; return(logger); }
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)); } }
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); } }
public object Clone() { var logger = new LoggerClass { Categories = Categories.ToList(), InstanceId = InstanceId, Destinations = Destinations.ToList() }; return logger; }