mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-13 11:44:46 +00:00
feat: adds methods to get/set websocket min log level
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user