mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 21:24:43 +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;
|
||||||
using Serilog.Core;
|
using Serilog.Core;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using Serilog.Formatting.Compact;
|
|
||||||
using Serilog.Formatting.Json;
|
using Serilog.Formatting.Json;
|
||||||
|
|
||||||
namespace PepperDash.Core
|
namespace PepperDash.Core
|
||||||
@@ -47,6 +46,11 @@ namespace PepperDash.Core
|
|||||||
|
|
||||||
private static LoggingLevelSwitch _websocketLoggingLevelSwitch;
|
private static LoggingLevelSwitch _websocketLoggingLevelSwitch;
|
||||||
|
|
||||||
|
public static LogEventLevel WebsocketMinimumLogLevel
|
||||||
|
{
|
||||||
|
get { return _websocketLoggingLevelSwitch.MinimumLevel; }
|
||||||
|
}
|
||||||
|
|
||||||
private static DebugWebsocketSink _websocketSink;
|
private static DebugWebsocketSink _websocketSink;
|
||||||
|
|
||||||
public static DebugWebsocketSink WebsocketSink
|
public static DebugWebsocketSink WebsocketSink
|
||||||
@@ -265,9 +269,11 @@ namespace PepperDash.Core
|
|||||||
_consoleLoggingLevelSwitch.MinimumLevel = level;
|
_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>
|
/// <summary>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace PepperDash.Core
|
|||||||
{
|
{
|
||||||
if (!Debug.IsRunningOnAppliance) return;
|
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,
|
InitialParametersClass.ApplicationNumber,
|
||||||
logEvent.Level,
|
logEvent.Level,
|
||||||
logEvent.RenderMessage());
|
logEvent.RenderMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user