mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-19 23:46:49 +00:00
feat: Add console command to report initialization exceptions for improved diagnostics
This commit is contained in:
parent
ac3b73cf32
commit
71cf7ef4df
1 changed files with 23 additions and 0 deletions
|
|
@ -191,6 +191,9 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
||||||
CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
|
CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
|
||||||
"getroutingports", "Reports all routing ports, if any. Requires a device key", ConsoleAccessLevelEnum.AccessOperator);
|
"getroutingports", "Reports all routing ports, if any. Requires a device key", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
|
CrestronConsole.AddNewConsoleCommand(PrintInitializationExceptions,
|
||||||
|
"getinitializationexceptions", "Reports any exceptions that occurred during initialization", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
DeviceManager.AddDevice(new EssentialsWebApi("essentialsWebApi", "Essentials Web API"));
|
DeviceManager.AddDevice(new EssentialsWebApi("essentialsWebApi", "Essentials Web API"));
|
||||||
|
|
||||||
if (!Debug.DoNotLoadConfigOnNextBoot)
|
if (!Debug.DoNotLoadConfigOnNextBoot)
|
||||||
|
|
@ -823,8 +826,28 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.LogMessage(LogEventLevel.Information, "All Rooms Loaded.");
|
Debug.LogMessage(LogEventLevel.Information, "All Rooms Loaded.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PrintInitializationExceptions(string args)
|
||||||
|
{
|
||||||
|
if(args.Contains("?"))
|
||||||
|
{
|
||||||
|
CrestronConsole.ConsoleCommandResponse("Usage: getinitializationexceptions\r\n");
|
||||||
|
CrestronConsole.ConsoleCommandResponse("Reports any exceptions that occurred during initialization.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (InitializationExceptions.Count == 0)
|
||||||
|
{
|
||||||
|
CrestronConsole.ConsoleCommandResponse("No initialization exceptions occurred.\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CrestronConsole.ConsoleCommandResponse("Initialization Exceptions:\r\n");
|
||||||
|
foreach (var ex in InitializationExceptions)
|
||||||
|
{
|
||||||
|
CrestronConsole.ConsoleCommandResponse(" - {0}: {1}\r\n", ex.GetType().FullName, ex.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue