mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-04-12 03:57:08 +00:00
feat: adds methods to get/set websocket min log level
This commit is contained in:
parent
3debb30d53
commit
65800193bb
2 changed files with 9 additions and 3 deletions
|
|
@ -11,7 +11,6 @@ using PepperDash.Core.DebugThings;
|
|||
using Serilog;
|
||||
using Serilog.Core;
|
||||
using Serilog.Events;
|
||||
using Serilog.Formatting.Compact;
|
||||
using Serilog.Formatting.Json;
|
||||
|
||||
namespace PepperDash.Core
|
||||
|
|
@ -47,6 +46,11 @@ namespace PepperDash.Core
|
|||
|
||||
private static LoggingLevelSwitch _websocketLoggingLevelSwitch;
|
||||
|
||||
public static LogEventLevel WebsocketMinimumLogLevel
|
||||
{
|
||||
get { return _websocketLoggingLevelSwitch.MinimumLevel; }
|
||||
}
|
||||
|
||||
private static DebugWebsocketSink _websocketSink;
|
||||
|
||||
public static DebugWebsocketSink WebsocketSink
|
||||
|
|
@ -265,9 +269,11 @@ namespace PepperDash.Core
|
|||
_consoleLoggingLevelSwitch.MinimumLevel = level;
|
||||
}
|
||||
|
||||
public static void SetWebSocketDebugLevel(LogEventLevel level)
|
||||
public static void SetWebSocketMinimumDebugLevel(LogEventLevel level)
|
||||
{
|
||||
_websocketLoggingLevelSwitch.MinimumLevel = level;
|
||||
|
||||
Console(0, "Websocket debug level set to {0}", _websocketLoggingLevelSwitch.MinimumLevel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace PepperDash.Core
|
|||
{
|
||||
if (!Debug.IsRunningOnAppliance) return;
|
||||
|
||||
CrestronConsole.PrintLine("[{0}]App {1} Lvl {2}:{3}", logEvent.Timestamp,
|
||||
CrestronConsole.PrintLine("[{0}][App {1}][Lvl {2}]: {3}", logEvent.Timestamp,
|
||||
InitialParametersClass.ApplicationNumber,
|
||||
logEvent.Level,
|
||||
logEvent.RenderMessage());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue