feat: change to use Debug.LogMessage everywhere

This commit is contained in:
Andrew Welker
2024-03-21 13:44:08 -05:00
parent 4d0e3b1943
commit ee4ccb0d1a
110 changed files with 1033 additions and 988 deletions

View File

@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Devices.Common.Sources;
using Serilog.Events;
namespace PepperDash.Essentials.Devices.Common.SoftCodec
@@ -40,19 +41,19 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
{
CrestronInvoke.BeginInvoke(o =>
{
Debug.Console(1, this, "Run route action '{0}' on SourceList: {1}", routeKey, sourceListKey);
Debug.LogMessage(LogEventLevel.Debug, this, "Run route action '{0}' on SourceList: {1}", routeKey, sourceListKey);
var dict = ConfigReader.ConfigObject.GetSourceListForKey(sourceListKey);
if (dict == null)
{
Debug.Console(1, this, "WARNING: Config source list '{0}' not found", sourceListKey);
Debug.LogMessage(LogEventLevel.Debug, this, "WARNING: Config source list '{0}' not found", sourceListKey);
return;
}
// Try to get the list item by it's string key
if (!dict.ContainsKey(routeKey))
{
Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
Debug.LogMessage(LogEventLevel.Debug, this, "WARNING: No item '{0}' found on config list '{1}'",
routeKey, sourceListKey);
return;
}
@@ -97,7 +98,7 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
if (dest == null)
{
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
Debug.LogMessage(LogEventLevel.Debug, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
return false;
}
@@ -112,7 +113,7 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
if (source == null)
{
Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
Debug.LogMessage(LogEventLevel.Debug, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
return false;
}
dest.ReleaseAndMakeRoute(source, route.Type);
@@ -169,7 +170,7 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new BlueJeansPc Device");
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new BlueJeansPc Device");
return new SoftCodec.BlueJeansPc(dc.Key, dc.Name);
}
}

View File

@@ -2,6 +2,7 @@
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using Serilog.Events;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -73,7 +74,7 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Attempting to create new Generic SoftCodec Device");
Debug.LogMessage(LogEventLevel.Debug, "Attempting to create new Generic SoftCodec Device");
var props = dc.Properties.ToObject<GenericSoftCodecProperties>();