Compare commits

...

1 Commits

Author SHA1 Message Date
Nick Genovese
37c1a6c7dd feat: implemented logging by key with Core
- updated log methods in a few places
2024-11-05 13:30:01 -05:00
19 changed files with 144 additions and 183 deletions

View File

@@ -15,11 +15,15 @@
<MakeDir Directories="$(PackageOutputPath)\$(AssemblyName)" Condition="!Exists('$(PackageOutputPath)\$(AssemblyName)')" /> <MakeDir Directories="$(PackageOutputPath)\$(AssemblyName)" Condition="!Exists('$(PackageOutputPath)\$(AssemblyName)')" />
<ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cplz" Overwrite="true"/> <ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cplz" Overwrite="true"/>
</Target> </Target>
<Target Name="Copy CPZ NET6" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net6.0' ) Or ( '$(TargetFramework)' == 'net8.0' ))"> <Target Name="Copy CPZ NET6" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net6.0' ))">
<Message Text="Copying CPZ"></Message> <Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" /> <Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
</Target> </Target>
<Target Name="Copy CPZ NET47" AfterTargets="SimplSharpPostProcess47" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' != 'net6.0' ) And ( '$(TargetFramework)' != 'net8.0' ))"> <Target Name="Copy CPZ NET8" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net8.0' ))">
<Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
</Target>
<Target Name="Copy CPZ NET47" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net472' ))">
<Message Text="Copying CPZ"></Message> <Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" /> <Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
</Target> </Target>

View File

@@ -91,7 +91,7 @@ namespace PepperDash.Essentials.Core
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogMessage(e, "Error invoking method {methodName} on device {deviceKey}", null, method.Name, action.DeviceKey); Debug.LogError(e, "Error invoking method {methodName} on device {deviceKey}", null, method.Name, action.DeviceKey);
} }
}); });
@@ -111,7 +111,7 @@ namespace PepperDash.Essentials.Core
var obj = FindObjectOnPath(key); var obj = FindObjectOnPath(key);
if (obj == null) if (obj == null)
{ {
Debug.LogMessage(LogEventLevel.Warning, "Unable to find object at path {deviceKey}", null, key); Debug.LogMessage(LogEventLevel.Warning, "Unable to find object at path {deviceKey}", key);
return; return;
} }
@@ -130,9 +130,7 @@ namespace PepperDash.Essentials.Core
if (method == null) if (method == null)
{ {
Debug.LogMessage(LogEventLevel.Warning, Debug.LogMessage(LogEventLevel.Warning, "Unable to find method with name {methodName} and that matches parameters {@parameters}", action.MethodName, action.Params);
"Unable to find method with name {methodName} and that matches parameters {@parameters}", null, action.MethodName,
action.Params);
return; return;
} }
var mParams = method.GetParameters(); var mParams = method.GetParameters();
@@ -145,18 +143,18 @@ namespace PepperDash.Essentials.Core
{ {
try try
{ {
Debug.LogMessage(LogEventLevel.Verbose, "Calling method {methodName} on device {deviceKey} with {@params}", null, method.Name, action.DeviceKey, action.Params); Debug.LogMessage(LogEventLevel.Verbose, "Calling method {methodName} on device {deviceKey} with {@params}", method.Name, action.DeviceKey, action.Params);
method.Invoke(obj, convertedParams); method.Invoke(obj, convertedParams);
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogMessage(e, "Error invoking method {methodName} on device {deviceKey}", null, method.Name, action.DeviceKey); Debug.LogError(e, "Error invoking method {methodName} on device {deviceKey}", method.Name, action.DeviceKey);
} }
}); });
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.LogMessage(ex, "Unable to call method with name {methodName} with {@parameters}", null, action.MethodName, action.Params); Debug.LogError(ex, "Unable to call method with name {methodName} with {@parameters}", action.MethodName, action.Params);
} }
} }

View File

@@ -149,7 +149,7 @@ namespace PepperDash.Essentials.Core
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.LogMessage(ex, "Exception occurred while creating device {0}: {1}", null, dc.Key, ex.Message); Debug.LogError(ex, "Exception occurred while creating device {0}: {1}", dc.Key, ex.Message);
return null; return null;
} }
} }

View File

@@ -1039,8 +1039,6 @@ namespace PepperDash.Essentials.Core.Fusion
/// Prints today's schedule to console for debugging /// Prints today's schedule to console for debugging
/// </summary> /// </summary>
private void PrintTodaysSchedule() private void PrintTodaysSchedule()
{
if (Debug.Level > 1)
{ {
if (_currentSchedule.Meetings.Count > 0) if (_currentSchedule.Meetings.Count > 0)
{ {
@@ -1057,7 +1055,6 @@ namespace PepperDash.Essentials.Core.Fusion
} }
} }
} }
}
protected virtual void SetUpSources() protected virtual void SetUpSources()
{ {

View File

@@ -35,7 +35,7 @@ namespace PepperDash.Essentials.Core
public static eCrestronSeries ProcessorSeries { get { return CrestronEnvironment.ProgramCompatibility; } } public static eCrestronSeries ProcessorSeries { get { return CrestronEnvironment.ProgramCompatibility; } }
// TODO: consider making this configurable later // TODO: consider making this configurable later
public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US"); public static IFormatProvider Culture = CultureInfo.InvariantCulture;
/// <summary> /// <summary>
/// True when the processor type is a DMPS variant /// True when the processor type is a DMPS variant

View File

@@ -1,15 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharp.Scheduler; using Crestron.SimplSharp.Scheduler;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Fusion;
using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Room.Config;
using Serilog.Events; using Serilog.Events;
using Activator = System.Activator;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {

View File

@@ -134,12 +134,6 @@ namespace PepperDash.Essentials.Core
Joins.Add(joinName, value); Joins.Add(joinName, value);
} }
if (Debug.Level > 0)
{
PrintJoinMapInfo();
}
} }
/// <summary> /// <summary>

View File

@@ -25,8 +25,9 @@
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.66" /> <PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.21.65" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-424" /> <PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.21.65" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-439" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Crestron\CrestronGenericBaseDevice.cs.orig" /> <None Include="Crestron\CrestronGenericBaseDevice.cs.orig" />

View File

@@ -102,8 +102,6 @@ namespace PepperDash.Essentials
LoadedAssemblies.Add(new LoadedAssembly(fi.Name, version, assembly)); LoadedAssemblies.Add(new LoadedAssembly(fi.Name, version, assembly));
} }
if (Debug.Level > 1)
{
Debug.LogMessage(LogEventLevel.Verbose, "Loaded Assemblies:"); Debug.LogMessage(LogEventLevel.Verbose, "Loaded Assemblies:");
foreach (var assembly in LoadedAssemblies) foreach (var assembly in LoadedAssemblies)
@@ -111,7 +109,6 @@ namespace PepperDash.Essentials
Debug.LogMessage(LogEventLevel.Verbose, "Assembly: {0}", assembly.Name); Debug.LogMessage(LogEventLevel.Verbose, "Assembly: {0}", assembly.Name);
} }
} }
}
public static void SetEssentialsAssembly(string name, Assembly assembly) public static void SetEssentialsAssembly(string name, Assembly assembly)
@@ -151,7 +148,7 @@ namespace PepperDash.Essentials
return null; return null;
} catch(Exception ex) } catch(Exception ex)
{ {
Debug.LogMessage(ex, "Error loading assembly from {path}", null, filePath); Debug.LogError(ex, "Error loading assembly from {path}", filePath);
return null; return null;
} }
@@ -360,7 +357,7 @@ namespace PepperDash.Essentials
foreach (var pluginFile in pluginFiles) foreach (var pluginFile in pluginFiles)
{ {
var loadedAssembly = LoadAssembly(pluginFile.FullName); var loadedAssembly = LoadAssembly(pluginFile.FullName);
if (loadedAssembly != null)
LoadedPluginFolderAssemblies.Add(loadedAssembly); LoadedPluginFolderAssemblies.Add(loadedAssembly);
} }
@@ -379,28 +376,18 @@ namespace PepperDash.Essentials
try try
{ {
var assy = loadedAssembly.Assembly; var assy = loadedAssembly.Assembly;
Type[] types = {};
try try
{ {
types = assy.GetTypes(); var types = assy.GetTypes().ToList();
Debug.LogMessage(LogEventLevel.Debug, $"Got types for assembly {assy.GetName().Name}"); Debug.LogMessage(LogEventLevel.Debug, $"Got types for assembly {assy.GetName().Name}");
}
catch (TypeLoadException e)
{
Debug.LogMessage(LogEventLevel.Error, "Unable to get types for assembly {0}: {1}",
loadedAssembly.Name, e.Message);
Debug.LogMessage(LogEventLevel.Verbose, e.StackTrace);
continue;
}
foreach (var type in types) foreach (var type in types)
{ {
try try
{ {
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract) if (typeof(IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract)
{ {
var plugin = var plugin = (IPluginDeviceFactory)Activator.CreateInstance(type);
(IPluginDeviceFactory)Activator.CreateInstance(type);
LoadCustomPlugin(plugin, loadedAssembly); LoadCustomPlugin(plugin, loadedAssembly);
} }
} }
@@ -410,19 +397,23 @@ namespace PepperDash.Essentials
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogMessage(LogEventLevel.Error, "Load Plugin not found. {0}.{2} is not a plugin factory. Exception: {1}", Debug.LogError(e, "Error loading plugin type: {Type}", type.Name);
loadedAssembly.Name, e.Message, type.Name);
continue;
} }
}
}
catch (TypeLoadException e)
{
Debug.LogError(e, "Unable to get types for assembly {0}", loadedAssembly.Name);
}
catch (Exception e)
{
Debug.LogError(e, "Unable to get types for assembly {0}", loadedAssembly.Name);
} }
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogMessage(LogEventLevel.Information, "Error Loading assembly {0}: {1}", Debug.LogError(e, "Error loading plugin assembly:{Assembly}", loadedAssembly);
loadedAssembly.Name, e.Message);
Debug.LogMessage(LogEventLevel.Verbose, "{0}", e.StackTrace);
continue;
} }
} }
// plugin dll will be loaded. Any classes in plugin should have a static constructor // plugin dll will be loaded. Any classes in plugin should have a static constructor

View File

@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.Core.Routing
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.LogMessage(ex, "Error handling midpoint update from {midpointKey}:{Exception}", this, midpoint.Key, ex); Debug.LogError<RoutingFeedbackManager>(ex, "Error handling midpoint update from {midpointKey}:{Exception}", this, midpoint.Key, ex);
} }
} }
@@ -59,7 +59,7 @@ namespace PepperDash.Essentials.Core.Routing
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.LogMessage(ex, "Error handling Sink update from {senderKey}:{Exception}", this, sender.Key, ex); Debug.LogError<RoutingFeedbackManager>(ex, "Error handling Sink update from {senderKey}:{Exception}", this, sender.Key, ex);
} }
} }
@@ -97,7 +97,7 @@ namespace PepperDash.Essentials.Core.Routing
} }
} catch (Exception ex) } catch (Exception ex)
{ {
Debug.LogMessage(ex, "Error getting first tieline: {Exception}", this, ex); Debug.LogError<RoutingFeedbackManager>(this, ex, "Error getting first tieline: {Exception}", ex);
return; return;
} }
@@ -124,7 +124,7 @@ namespace PepperDash.Essentials.Core.Routing
} }
} catch(Exception ex) } catch(Exception ex)
{ {
Debug.LogMessage(ex, "Error getting sourceTieLine: {Exception}", this, ex); Debug.LogError<RoutingFeedbackManager>(this, ex, "Error getting sourceTieLine: {Exception}", ex);
return; return;
} }
@@ -261,7 +261,7 @@ namespace PepperDash.Essentials.Core.Routing
} }
} catch (Exception ex) } catch (Exception ex)
{ {
Debug.LogMessage(ex, "Error walking tieLines: {Exception}", this, ex); Debug.LogError(this, ex, "Error walking tieLines: {Exception}", ex);
return null; return null;
} }

View File

@@ -2,7 +2,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Core.Web.RequestHandlers; using PepperDash.Core.Web.RequestHandlers;
using System;
using Serilog.Events; using Serilog.Events;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
@@ -27,7 +26,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
/// <param name="context"></param> /// <param name="context"></param>
protected override void HandleGet(HttpCwsContext context) protected override void HandleGet(HttpCwsContext context)
{ {
var appDebug = new AppDebug { MinimumLevel = Debug.WebsocketMinimumLogLevel }; var appDebug = new AppDebug { MinimumLevel = Debug.WebsocketMinimumLevel };
var body = JsonConvert.SerializeObject(appDebug, Formatting.Indented); var body = JsonConvert.SerializeObject(appDebug, Formatting.Indented);
@@ -67,7 +66,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
Debug.SetWebSocketMinimumDebugLevel(requestBody.MinimumLevel); Debug.SetWebSocketMinimumDebugLevel(requestBody.MinimumLevel);
appDebug.MinimumLevel = Debug.WebsocketMinimumLogLevel; appDebug.MinimumLevel = Debug.WebsocketMinimumLevel;
var responseBody = JsonConvert.SerializeObject(appDebug, Formatting.Indented); var responseBody = JsonConvert.SerializeObject(appDebug, Formatting.Indented);
context.Response.StatusCode = 200; context.Response.StatusCode = 200;

View File

@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
/// Gets details for a debug session /// Gets details for a debug session
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context"></param>
protected override void HandleGet(Crestron.SimplSharp.WebScripting.HttpCwsContext context) protected override void HandleGet(HttpCwsContext context)
{ {
var routeData = context.Request.RouteData; var routeData = context.Request.RouteData;
if (routeData == null) if (routeData == null)
@@ -38,29 +38,12 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
try try
{ {
var ip = CrestronEthernetHelper.GetEthernetParameter( var data = new
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0);
var port = 0;
if (!Debug.WebsocketSink.IsRunning)
{ {
Debug.LogMessage(LogEventLevel.Information, "Starting WS Server"); url = "" // TODO: Add the URL of the websocket server
// Generate a random port within a specified range
port = new Random().Next(65435, 65535);
// Start the WS Server
Debug.WebsocketSink.StartServerAndSetPort(port);
Debug.SetWebSocketMinimumDebugLevel(Serilog.Events.LogEventLevel.Verbose);
}
var url = Debug.WebsocketSink.Url;
object data = new
{
url = Debug.WebsocketSink.Url
}; };
Debug.LogMessage(LogEventLevel.Information, "Debug Session URL: {0}", url); Debug.LogMessage(LogEventLevel.Information, "Debug Session URL: {0}", data.url);
// Return the port number with the full url of the WS Server // Return the port number with the full url of the WS Server
var res = JsonConvert.SerializeObject(data); var res = JsonConvert.SerializeObject(data);
@@ -84,8 +67,6 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
/// <param name="context"></param> /// <param name="context"></param>
protected override void HandlePost(HttpCwsContext context) protected override void HandlePost(HttpCwsContext context)
{ {
Debug.WebsocketSink.StopServer();
context.Response.StatusCode = 200; context.Response.StatusCode = 200;
context.Response.StatusDescription = "OK"; context.Response.StatusDescription = "OK";
context.Response.End(); context.Response.End();

View File

@@ -71,8 +71,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
var daw = new DeviceActionWrapper { DeviceKey = (string) deviceKey}; var daw = new DeviceActionWrapper { DeviceKey = (string) deviceKey};
JsonConvert.PopulateObject(data, daw); JsonConvert.PopulateObject(data, daw);
Debug.LogMessage<DevJsonRequestHandler>(LogEventLevel.Verbose, "Device Action Wrapper: {@wrapper}", null, daw);
Debug.LogMessage(LogEventLevel.Verbose, "Device Action Wrapper: {@wrapper}", null, daw);
DeviceJsonApi.DoDeviceAction(daw); DeviceJsonApi.DoDeviceAction(daw);
@@ -82,7 +81,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.LogMessage(ex, "Error handling device command: {Exception}"); Debug.LogError<DevJsonRequestHandler>(ex, "Error handling device command: {Exception}");
context.Response.StatusCode = 400; context.Response.StatusCode = 400;
context.Response.StatusDescription = "Bad Request"; context.Response.StatusDescription = "Bad Request";

View File

@@ -193,7 +193,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
void SendBytes(byte[] b) void SendBytes(byte[] b)
{ {
if (Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1 if (Debug.ConsoleMinimumLevel == LogEventLevel.Verbose) // This check is here to prevent following string format from building unnecessarily on level 0 or 1
Debug.LogMessage(LogEventLevel.Verbose, this, "Sending:{0}", ComTextHelper.GetEscapedText(b)); Debug.LogMessage(LogEventLevel.Verbose, this, "Sending:{0}", ComTextHelper.GetEscapedText(b));
Communication.SendBytes(b); Communication.SendBytes(b);
@@ -209,7 +209,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
// Append the incoming bytes with whatever is in the buffer // Append the incoming bytes with whatever is in the buffer
IncomingBuffer.CopyTo(newBytes, 0); IncomingBuffer.CopyTo(newBytes, 0);
e.Bytes.CopyTo(newBytes, IncomingBuffer.Length); e.Bytes.CopyTo(newBytes, IncomingBuffer.Length);
if (Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1 if (Debug.ConsoleMinimumLevel == LogEventLevel.Verbose) // This check is here to prevent following string format from building unnecessarily on level 0 or 1
Debug.LogMessage(LogEventLevel.Verbose, this, "Received:{0}", ComTextHelper.GetEscapedText(newBytes)); Debug.LogMessage(LogEventLevel.Verbose, this, "Received:{0}", ComTextHelper.GetEscapedText(newBytes));
byte[] message = new byte[] { }; byte[] message = new byte[] { };

View File

@@ -120,7 +120,7 @@ namespace PepperDash.Essentials.Devices.Common.Displays
// Fake cool-down cycle // Fake cool-down cycle
CooldownTimer = new CTimer(o => CooldownTimer = new CTimer(o =>
{ {
Debug.LogMessage(LogEventLevel.Verbose, "Cooldown timer ending", this); Debug.LogMessage(LogEventLevel.Verbose, this, "Cooldown timer ending");
_IsCoolingDown = false; _IsCoolingDown = false;
IsCoolingDownFeedback.InvokeFireUpdate(); IsCoolingDownFeedback.InvokeFireUpdate();
_PowerIsOn = false; _PowerIsOn = false;
@@ -141,7 +141,7 @@ namespace PepperDash.Essentials.Devices.Common.Displays
{ {
try try
{ {
Debug.LogMessage(LogEventLevel.Verbose, "ExecuteSwitch: {0}", this, selector); Debug.LogMessage(LogEventLevel.Verbose, this, "ExecuteSwitch: {0}", selector);
if (!_PowerIsOn) if (!_PowerIsOn)
{ {
@@ -156,21 +156,21 @@ namespace PepperDash.Essentials.Devices.Common.Displays
var inputPort = InputPorts.FirstOrDefault(port => var inputPort = InputPorts.FirstOrDefault(port =>
{ {
Debug.LogMessage(LogEventLevel.Verbose, "Checking input port {inputPort} with selector {portSelector} against {selector}", this, port, port.Selector, selector); Debug.LogMessage(LogEventLevel.Verbose, this, "Checking input port {inputPort} with selector {portSelector} against {selector}", port, port.Selector, selector);
return port.Selector.ToString() == selector.ToString(); return port.Selector.ToString() == selector.ToString();
}); });
if (inputPort == null) if (inputPort == null)
{ {
Debug.LogMessage(LogEventLevel.Verbose, "Unable to find input port for selector {selector}", this, selector); Debug.LogMessage(LogEventLevel.Verbose, this, "Unable to find input port for selector {selector}", selector);
return; return;
} }
Debug.LogMessage(LogEventLevel.Verbose, "Setting current input port to {inputPort}", this, inputPort); Debug.LogMessage(LogEventLevel.Verbose, this, "Setting current input port to {inputPort}", inputPort);
CurrentInputPort = inputPort; CurrentInputPort = inputPort;
} catch (Exception ex) } catch (Exception ex)
{ {
Debug.LogMessage(ex, "Error making switch: {Exception}", this, ex); Debug.LogError<MockDisplay>(this, ex, "Error making switch");
} }
} }

View File

@@ -29,7 +29,8 @@
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" /> <ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.66" /> <PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.21.65" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-424" /> <PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.21.65" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-439" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp.CrestronIO; using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;

View File

@@ -92,7 +92,6 @@ namespace PepperDash.Essentials
private void StartSystem(object preventInitialization) private void StartSystem(object preventInitialization)
{ {
Debug.SetErrorLogMinimumDebugLevel(Serilog.Events.LogEventLevel.Verbose);
DeterminePlatform(); DeterminePlatform();
@@ -241,7 +240,7 @@ namespace PepperDash.Essentials
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogMessage(e, "Unable to determine platform due to exception"); Debug.LogError(e, "Unable to determine platform due to exception");
} }
} }
@@ -297,7 +296,7 @@ namespace PepperDash.Essentials
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogMessage(e, "FATAL INITIALIZE ERROR. System is in an inconsistent state"); Debug.LogFatal(e, "FATAL INITIALIZE ERROR. System is in an inconsistent state");
} }
finally finally
{ {
@@ -431,7 +430,7 @@ namespace PepperDash.Essentials
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogMessage(e, "ERROR: Creating device {deviceKey:l}. Skipping device.",args: new[] { devConf.Key }); Debug.LogError(e, "ERROR: Creating device {deviceKey:l}. Skipping device.",args: new[] { devConf.Key });
} }
} }
Debug.LogMessage(LogEventLevel.Information, "All Devices Loaded."); Debug.LogMessage(LogEventLevel.Information, "All Devices Loaded.");

View File

@@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<ProjectType>Program</ProjectType> <ProjectType>Program</ProjectType>
<Configurations>Debug;Release;Debug 4.7.2</Configurations> <Configurations>Debug;Release</Configurations>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<RootNamespace>PepperDash.Essentials</RootNamespace> <RootNamespace>PepperDash.Essentials</RootNamespace>
<AssemblyName>PepperDashEssentials</AssemblyName> <AssemblyName>PepperDashEssentials</AssemblyName>
<TargetFrameworks>net472;net6</TargetFrameworks> <TargetFrameworks>net472;net6.0;net8.0</TargetFrameworks>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo> <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<OutputPath>bin\$(Configuration)\</OutputPath> <OutputPath>bin\$(Configuration)\</OutputPath>
<Title>PepperDash Essentials</Title> <Title>PepperDash Essentials</Title>
<PackageId>PepperDashEssentials</PackageId> <PackageId>PepperDashEssentials</PackageId>
<Version>2.0.0-local</Version> <Version>2.0.0-local</Version>
<InvariantGlobalization>true</InvariantGlobalization>
<InformationalVersion>$(Version)</InformationalVersion> <InformationalVersion>$(Version)</InformationalVersion>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup> </PropertyGroup>
@@ -48,8 +49,9 @@
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.20.66" /> <PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.21.65" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-424" /> <PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.21.65" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-439" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" /> <ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" />