From 724442653fea76476fe0ca3cc6bdee27c3005fbd Mon Sep 17 00:00:00 2001 From: Nick Genovese Date: Wed, 13 Nov 2024 09:13:05 -0500 Subject: [PATCH] fix: remove debug for every response and cleaned up log error --- src/SonyBraviaDevice.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/SonyBraviaDevice.cs b/src/SonyBraviaDevice.cs index 0da8874..9f85977 100644 --- a/src/SonyBraviaDevice.cs +++ b/src/SonyBraviaDevice.cs @@ -14,6 +14,7 @@ using System.Globalization; using System.Linq; using System.Text.RegularExpressions; +using Serilog.Events; using TwoWayDisplayBase = PepperDash.Essentials.Devices.Common.Displays.TwoWayDisplayBase; namespace SonyBraviaEpi @@ -388,8 +389,6 @@ public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, E private int _rawVolume; - - public BoolFeedback MuteFeedback { get; private set; } public IntFeedback VolumeLevelFeedback { get; private set; } @@ -833,7 +832,7 @@ private void ProcessRs232Response(byte[] response) // Debug.Console(DebugLevels.DebugLevel, this, "ProcessRs232Response: {0}", ComTextHelper.GetEscapedText(buffer)); - Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "ProcessRs232Response: {lastCommand}:{response}", this, ComTextHelper.GetEscapedText(_lastCommand), ComTextHelper.GetEscapedText(buffer)); + // Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "ProcessRs232Response: {lastCommand}:{response}", this, ComTextHelper.GetEscapedText(_lastCommand), ComTextHelper.GetEscapedText(buffer)); //it starts a valid response if (buffer.Length >= 3) @@ -876,10 +875,7 @@ private void ProcessRs232Response(byte[] response) } catch (Exception ex) { - Debug.Console(DebugLevels.TraceLevel, this, Debug.ErrorLogLevel.Error, "ProcessRs232Response Exception: {0}", ex.Message); - Debug.Console(DebugLevels.DebugLevel, this, Debug.ErrorLogLevel.Error, "ProcessRs232Response Exception Stack Trace: {0}", ex.StackTrace); - if (ex.InnerException != null) - Debug.Console(DebugLevels.ErrorLevel, this, Debug.ErrorLogLevel.Error, "ProcessRs232Response Inner Exception: {0}", ex.InnerException); + Debug.LogMessage(ex, "Caught an exception in ProcessRs232Response: {0}", this, ex.Message); } }