fix: minor updates to debug levels

This commit is contained in:
Neil Dorin
2024-01-15 13:30:14 -07:00
parent a2c628145d
commit 876689fdfe
5 changed files with 8 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ using PepperDash.Core;
using PepperDash.Core.Web.RequestHandlers;
using System;
using Serilog.Events;
using Newtonsoft.Json.Converters;
namespace PepperDash.Essentials.Core.Web.RequestHandlers
{
@@ -28,7 +29,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
{
var appDebug = new AppDebug { MinimumLevel = Debug.WebsocketMinimumLogLevel };
var body = JsonConvert.SerializeObject((appDebug, Formatting.Indented, new JsonSerializerSettings( ));
var body = JsonConvert.SerializeObject(appDebug, Formatting.Indented);
context.Response.StatusCode = 200;
context.Response.StatusDescription = "OK";
@@ -79,6 +80,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
public class AppDebug
{
[JsonProperty("minimumLevel", NullValueHandling = NullValueHandling.Ignore)]
public LogEventLevel MinimumLevel { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public LogEventLevel MinimumLevel { get; set; }
}
}