static void Main() { LogManager.Configuration.Variables["dir"] = new FileInfo(Application.ExecutablePath).Directory.FullName + Path.DirectorySeparatorChar; LogManager.Configuration.Variables["dir2"] = DateTime.Now.ToString("yyyy-MM-dd"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new CameraApiSampleWindow()); } catch (Exception ex) { ExceptionLogWriter.WriteLog(ex, Exception_Log); } }
public static void WriteException(Exception ex, Logger logger) { if (IVLCamVariables.isCapturing) { IVLCamVariables.intucamHelper.WriteCaptureLog(); } IntucamBoardCommHelper.BulkLogList.RemoveAll(x => (x.Count == 0)); IVLCamVariables.logClass.BulkTransferLogList.AddRange(IntucamBoardCommHelper.BulkLogList); IntucamBoardCommHelper.InterruptLogList.RemoveAll(x => x.Count == 0); IVLCamVariables.logClass.BulkTransferLogList.AddRange(IntucamBoardCommHelper.InterruptLogList); IVLCamVariables.logClass.BulkTransferLogList = IVLCamVariables.logClass.BulkTransferLogList.OrderBy(x => x["TimeStamp"]).ToList();; IntucamBoardCommHelper.BulkLogList.Clear(); IVLCamVariables.logClass.InterruptTransferLogList.AddRange(IntucamBoardCommHelper.InterruptLogList); IntucamBoardCommHelper.InterruptLogList.Clear(); IVLCamVariables.logClass.CameraLogList.AddRange(IVLCamVariables.CameraLogList); IVLCamVariables.CameraLogList.Clear(); IVLCamVariables.logClass.FrameLogList.AddRange(Camera.frameLogList); IVLCamVariables.logClass.WriteLogs2File(); ExceptionLogWriter.WriteLog(ex, logger); }