chore: update some logging methods

This commit is contained in:
Andrew Welker
2025-03-25 23:58:51 -05:00
parent 26116d0495
commit a5bc79c469
7 changed files with 12 additions and 7 deletions

View File

@@ -741,7 +741,7 @@ namespace PepperDash.Core
{
if (HeartbeatEnabled)
{
Debug.Console(2, this, "Starting Heartbeat");
this.LogVerbose("Starting Heartbeat");
if (HeartbeatSendTimer == null)
{

View File

@@ -686,7 +686,7 @@ namespace PepperDash.Core
}
catch (Exception e)
{
this.LogException(ex, "DequeueEvent error");
this.LogException(e, "DequeueEvent error");
}
// Make sure to leave the CCritical section in case an exception above stops this thread, or we won't be able to restart it.
if (DequeueLock != null)

View File

@@ -17,6 +17,7 @@ using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronSockets;
using PepperDash.Core.Logging;
namespace PepperDash.Core
{
@@ -445,7 +446,7 @@ namespace PepperDash.Core
/// </summary>
public void Disconnect()
{
Debug.Console(2, "Disconnect Called");
this.LogVerbose("Disconnect Called");
DisconnectCalledByUser = true;
if (IsConnected)

View File

@@ -15,6 +15,7 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronSockets;
using PepperDash.Core.Logging;
namespace PepperDash.Core
{
@@ -526,7 +527,7 @@ namespace PepperDash.Core
{
SocketErrorCodes error = myTcpServer.SendDataAsync(i, b, b.Length, (x, y, z) => { });
if (error != SocketErrorCodes.SOCKET_OK && error != SocketErrorCodes.SOCKET_OPERATION_PENDING)
Debug.Console(2, error.ToString());
this.LogError("{error}",error.ToString());
}
}
}

View File

@@ -6,6 +6,7 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronSockets;
using Newtonsoft.Json;
using PepperDash.Core.Logging;
namespace PepperDash.Core
{
@@ -279,7 +280,7 @@ namespace PepperDash.Core
}
catch (Exception ex)
{
Debug.Console(0, "GenericUdpServer Receive error: {0}{1}", ex.Message, ex.StackTrace);
this.LogException(ex, "GenericUdpServer Receive error");
}
finally
{