From 826b7fd6d5dab86bde061451f09f848c35dace45 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 15 May 2024 15:30:54 -0500 Subject: [PATCH 1/3] fix: add factory for mock display in Devices.Common --- .../Displays/MockDisplay.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs b/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs index a1241821..bcbbaa5a 100644 --- a/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs +++ b/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs @@ -6,6 +6,7 @@ using Crestron.SimplSharpPro.DeviceSupport; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Bridges; +using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.DeviceTypeInterfaces; using PepperDash.Essentials.Core.Routing; using Serilog.Events; @@ -251,4 +252,18 @@ namespace PepperDash.Essentials.Devices.Common.Displays } + + public class MockDisplayFactory : EssentialsDeviceFactory + { + public MockDisplayFactory() + { + TypeNames = new List() { "mockdisplay2" }; + } + + public override EssentialsDevice BuildDevice(DeviceConfig dc) + { + Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new Mock Display Device"); + return new MockDisplay(dc.Key, dc.Name); + } + } } \ No newline at end of file From 4d19ecde00054b2f813c270248fc0a2e5b8aacbc Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 16 May 2024 00:32:02 -0500 Subject: [PATCH 2/3] build: update PD Core and dependencies --- .../PepperDash.Essentials.Core.csproj | 4 ++-- .../PepperDash.Essentials.Devices.Common.csproj | 4 ++-- src/PepperDash.Essentials/PepperDash.Essentials.csproj | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj b/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj index da717cb4..3cb80324 100644 --- a/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj +++ b/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj @@ -22,8 +22,8 @@ pdbonly - - + + diff --git a/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj b/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj index abfcd9c2..34433189 100644 --- a/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj +++ b/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj @@ -26,7 +26,7 @@ - - + + \ No newline at end of file diff --git a/src/PepperDash.Essentials/PepperDash.Essentials.csproj b/src/PepperDash.Essentials/PepperDash.Essentials.csproj index e10707c2..885a0970 100644 --- a/src/PepperDash.Essentials/PepperDash.Essentials.csproj +++ b/src/PepperDash.Essentials/PepperDash.Essentials.csproj @@ -46,8 +46,8 @@ - - + + From 5820c9d282f25d9f32f7e6be56d4f83dfea313cb Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 16 May 2024 00:38:02 -0500 Subject: [PATCH 3/3] fix: set error log level to to verbose on VC-4 Update catch log methods to use updated LogMessage method --- .../Comm and IR/GenericHttpClient.cs | 1 - src/PepperDash.Essentials/ControlSystem.cs | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs b/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs index fa6c298a..0347da80 100644 --- a/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs +++ b/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs @@ -5,7 +5,6 @@ using System.Text; using Crestron.SimplSharp; using Crestron.SimplSharp.Net.Http; using PepperDash.Core; -using PepperDash.Core.DebugThings; namespace PepperDash.Essentials.Core { diff --git a/src/PepperDash.Essentials/ControlSystem.cs b/src/PepperDash.Essentials/ControlSystem.cs index 84bf12ec..af87158b 100644 --- a/src/PepperDash.Essentials/ControlSystem.cs +++ b/src/PepperDash.Essentials/ControlSystem.cs @@ -34,6 +34,8 @@ namespace PepperDash.Essentials SecretsManager.Initialize(); SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true; + Debug.SetErrorLogMinimumDebugLevel(CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance ? LogEventLevel.Warning : LogEventLevel.Verbose); + // AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve; } @@ -162,7 +164,7 @@ namespace PepperDash.Essentials { try { - Debug.LogMessage(LogEventLevel.Information, "Determining Platform..."); + Debug.LogMessage(LogEventLevel.Information, "Determining Platform..."); string filePathPrefix; @@ -240,7 +242,7 @@ namespace PepperDash.Essentials } catch (Exception e) { - Debug.LogMessage(LogEventLevel.Error, "Unable to determin platform due to exception: {exception}", e.Message); + Debug.LogMessage(e, "Unable to determine platform due to exception"); } } @@ -296,7 +298,7 @@ namespace PepperDash.Essentials } catch (Exception e) { - Debug.LogMessage(LogEventLevel.Information, "FATAL INITIALIZE ERROR. System is in an inconsistent state: {exception}", e); + Debug.LogMessage(e, "FATAL INITIALIZE ERROR. System is in an inconsistent state"); } finally { @@ -428,7 +430,7 @@ namespace PepperDash.Essentials } catch (Exception e) { - Debug.LogMessage(LogEventLevel.Information, "ERROR: Creating device {deviceKey:l}. Skipping device. \r\n{exception}", devConf.Key, e); + Debug.LogMessage(e, "ERROR: Creating device {deviceKey:l}. Skipping device.",args: new[] { devConf.Key }); } } Debug.LogMessage(LogEventLevel.Information, "All Devices Loaded.");