private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { LogFramework.WriteNewLog($"Critical error: {((Exception)(e.ExceptionObject)).Message}", CClass, Instance, null, LogEnums.ResultCode.Error, ConsoleColor.Green, (Exception)e.ExceptionObject); //CommandActions.Mes($"{((Exception)(e.ExceptionObject)).Message}", ConsoleColor.Red); UnException?.Invoke(e); LogFramework.SaveLogs(); }
private static void CurrentDomain_ProcessExit(object sender, EventArgs e) { MeasureSpeed = Stopwatch.StartNew(); Exit?.Invoke(e); StoppedTimeMs = MeasureSpeed.Elapsed.TotalMilliseconds; MeasureSpeed.Stop(); LogFramework.WriteNewLog($"Good bye! (ended for {StoppedTimeMs} ms.)", CClass, Instance, null, LogEnums.ResultCode.OKMethod); LogFramework.SaveLogs(); }