mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 10:58:28 +00:00
fix: Replace console print statements with logging for sent and received bytes and text so they always print in both console and websocked debug
This commit is contained in:
parent
e23c987516
commit
7aa813ae7e
1 changed files with 20 additions and 4 deletions
|
|
@ -21,7 +21,11 @@ namespace PepperDash.Core
|
||||||
|
|
||||||
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
|
||||||
CrestronConsole.PrintLine($"[{timestamp}][{app}][{comms.Key}] Sending {bytes.Length} bytes: '{ComTextHelper.GetEscapedText(bytes)}'");
|
Debug.LogMessage(
|
||||||
|
level: Serilog.Events.LogEventLevel.Fatal,
|
||||||
|
message: $"Sending {bytes.Length} bytes: '{ComTextHelper.GetEscapedText(bytes)}'",
|
||||||
|
device: comms
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -35,7 +39,11 @@ namespace PepperDash.Core
|
||||||
|
|
||||||
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
|
||||||
CrestronConsole.PrintLine($"[{timestamp}][{app}][{comms.Key}] Received {bytes.Length} bytes: '{ComTextHelper.GetEscapedText(bytes)}'");
|
Debug.LogMessage(
|
||||||
|
level: Serilog.Events.LogEventLevel.Fatal,
|
||||||
|
message: $"Received {bytes.Length} bytes: '{ComTextHelper.GetEscapedText(bytes)}'",
|
||||||
|
device: comms
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -49,7 +57,11 @@ namespace PepperDash.Core
|
||||||
|
|
||||||
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
|
||||||
CrestronConsole.PrintLine($"[{timestamp}][{app}][{comms.Key}] Sending Text: '{ComTextHelper.GetDebugText(text)}'");
|
Debug.LogMessage(
|
||||||
|
level: Serilog.Events.LogEventLevel.Fatal,
|
||||||
|
message: $"Sending Text: '{ComTextHelper.GetDebugText(text)}'",
|
||||||
|
device: comms
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -63,7 +75,11 @@ namespace PepperDash.Core
|
||||||
|
|
||||||
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
|
||||||
CrestronConsole.PrintLine($"[{timestamp}][{app}][{comms.Key}] Received Text: '{ComTextHelper.GetDebugText(text)}'");
|
Debug.LogMessage(
|
||||||
|
level: Serilog.Events.LogEventLevel.Fatal,
|
||||||
|
message: $"Received Text: '{ComTextHelper.GetDebugText(text)}'",
|
||||||
|
device: comms
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue