fix: enable internal logging for the websocket at the trace level

This commit is contained in:
Andrew Welker
2025-09-29 10:48:34 -05:00
parent 0efddcf5ab
commit 650fa3aab0
2 changed files with 43 additions and 5 deletions

View File

@@ -252,7 +252,7 @@ namespace PepperDash.Essentials
return _wsClient2.IsAlive && IsAuthorized; return _wsClient2.IsAlive && IsAuthorized;
}); });
Debug.SetFileMinimumDebugLevel(Serilog.Events.LogEventLevel.Debug); Debug.SetFileMinimumDebugLevel(Serilog.Events.LogEventLevel.Verbose);
} }
private void SetupDefaultRoomMessengers() private void SetupDefaultRoomMessengers()
@@ -1338,13 +1338,38 @@ namespace PepperDash.Essentials
Log = Log =
{ {
Output = (data, s) => Output = (data, s) =>
this.LogDebug( {
"Message from websocket: {message}", switch (data.Level)
data {
) case LogLevel.Trace:
this.LogVerbose(data.Message);
break;
case LogLevel.Debug:
this.LogDebug(data.Message);
break;
case LogLevel.Info:
this.LogInformation(data.Message);
break;
case LogLevel.Warn:
this.LogWarning(data.Message);
break;
case LogLevel.Error:
this.LogError(data.Message);
break;
case LogLevel.Fatal:
this.LogFatal(data.Message);
break;
}
}
} }
}; };
// if Essentials is running on a server, set the log level to the lowest level to get the most detail in the logs
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Server)
{
_wsClient2.Log.Level = LogLevel.Trace;
}
_wsClient2.SslConfiguration.EnabledSslProtocols = _wsClient2.SslConfiguration.EnabledSslProtocols =
System.Security.Authentication.SslProtocols.Tls11 System.Security.Authentication.SslProtocols.Tls11
| System.Security.Authentication.SslProtocols.Tls12; | System.Security.Authentication.SslProtocols.Tls12;

View File

@@ -200,6 +200,19 @@ namespace PepperDash.Essentials.Touchpanel
this.csSubnetMask = System.Net.IPAddress.Parse(csSubnetMask); this.csSubnetMask = System.Net.IPAddress.Parse(csSubnetMask);
this.csIpAddress = System.Net.IPAddress.Parse(csIpAddress); this.csIpAddress = System.Net.IPAddress.Parse(csIpAddress);
} }
catch (ArgumentException)
{
Debug.LogInformation("This processor does not have a CS LAN", this);
}
catch (InvalidOperationException)
{
Debug.LogInformation("This processor does not have a CS LAN", this);
}
catch (Exception ex)
{
Debug.LogError($"Unexpected exception when checking CS LAN: {ex}", this);
}
}
/// <summary> /// <summary>
/// Updates the theme setting for this touchpanel controller and persists the change to configuration. /// Updates the theme setting for this touchpanel controller and persists the change to configuration.