public static void Exit(bool quickShutdown) { if (quickShutdown) { GracefullModuleShutdown = false; if (Controller != null) { Controller.InitGpioShutdownTasks(); } if (TaskManager != null) { TaskManager.OnCoreShutdownRequested(); } if (Update != null) { Update.StopUpdateTimer(); Logger.Log("Update timer disposed!", Enums.LogLevels.Trace); } if (RefreshConsoleTitleTimer != null) { RefreshConsoleTitleTimer.Dispose(); Logger.Log("Console title refresh timer disposed!", Enums.LogLevels.Trace); } Logger.Log("Bye, Sorry to see you go so fast!"); Logging.LoggerOnShutdown(); Environment.Exit(0); } }
public static async Task Exit(int exitCode = 0) { if (exitCode != 0) { GracefullModuleShutdown = false; Logger.Log("Exiting with nonzero error code...", Enums.LogLevels.Error); } if (exitCode == 0) { GracefullModuleShutdown = true; await OnExit().ConfigureAwait(false); } Logger.Log("Bye, have a good day sir!"); Logging.LoggerOnShutdown(); Environment.Exit(exitCode); }
public void ShutdownLogger() => Logging.LoggerOnShutdown();