diff --git a/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs b/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs index 3b9bc65..742be1a 100644 --- a/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs +++ b/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs @@ -213,6 +213,10 @@ namespace ICD.Common.Utils [PublicAPI] public static void RestartProgram() { + ILoggerService logger = ServiceProvider.TryGetService(); + if (logger != null) + logger.AddEntry(eSeverity.Informational, "Intentional Restart of Program"); + string consoleResult = string.Empty; string command = string.Format("progreset -p:{0:D2}", ProgramUtils.ProgramNumber); IcdConsole.SendControlSystemCommand(command, ref consoleResult); @@ -224,6 +228,10 @@ namespace ICD.Common.Utils [PublicAPI] public static void Reboot() { + ILoggerService logger = ServiceProvider.TryGetService(); + if (logger != null) + logger.AddEntry(eSeverity.Informational, "Intentional Reboot of Processor"); + string consoleResult = string.Empty; IcdConsole.SendControlSystemCommand("reboot", ref consoleResult); } diff --git a/ICD.Common.Utils/ProcessorUtils.Standard.cs b/ICD.Common.Utils/ProcessorUtils.Standard.cs index 4dcc183..e1650ed 100644 --- a/ICD.Common.Utils/ProcessorUtils.Standard.cs +++ b/ICD.Common.Utils/ProcessorUtils.Standard.cs @@ -5,6 +5,8 @@ using System.Linq; using System.Management; using ICD.Common.Properties; using ICD.Common.Utils.IO; +using ICD.Common.Utils.Services; +using ICD.Common.Utils.Services.Logging; using Microsoft.Win32; namespace ICD.Common.Utils @@ -163,6 +165,10 @@ namespace ICD.Common.Utils if (string.IsNullOrEmpty(filename) || !IcdFile.Exists(filename)) throw new InvalidOperationException("Failed to find program filename"); + ILoggerService logger = ServiceProvider.TryGetService(); + if (logger != null) + logger.AddEntry(eSeverity.Informational, "Intentional Restart of Program"); + Process.Start(filename); Environment.Exit(0); } @@ -173,6 +179,10 @@ namespace ICD.Common.Utils [PublicAPI] public static void Reboot() { + ILoggerService logger = ServiceProvider.TryGetService(); + if (logger != null) + logger.AddEntry(eSeverity.Informational, "Intentional Reboot of Processor"); + // TODO - Linux ProcessStartInfo psi = new ProcessStartInfo("shutdown", "/r /t 0")