feat: more debug testing

This commit is contained in:
Neil Dorin
2023-11-23 23:11:36 -07:00
parent 3eaa86905f
commit d2877f2cec
13 changed files with 192 additions and 18 deletions

View File

@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
/// <param name="context"></param>
protected override void HandleGet(HttpCwsContext context)
{
var appDebug = new AppDebug { Level = Debug.Level };
var appDebug = new AppDebug { MinimumLevel = Debug.WebsocketMinimumLogLevel };
var body = JsonConvert.SerializeObject(appDebug, Formatting.Indented);
@@ -62,9 +62,9 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
var appDebug = new AppDebug();
var requestBody = JsonConvert.DeserializeAnonymousType(data, appDebug);
Debug.SetDebugLevel(requestBody.Level);
Debug.SetWebSocketMinimumDebugLevel(requestBody.MinimumLevel);
appDebug.Level = Debug.Level;
appDebug.MinimumLevel = Debug.WebsocketMinimumLogLevel;
var responseBody = JsonConvert.SerializeObject(appDebug, Formatting.Indented);
context.Response.StatusCode = 200;
@@ -76,7 +76,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
public class AppDebug
{
[JsonProperty("level", NullValueHandling = NullValueHandling.Ignore)]
public int Level { get; set; }
[JsonProperty("minimumLevel", NullValueHandling = NullValueHandling.Ignore)]
public Serilog.Events.LogEventLevel MinimumLevel { get; set; }
}
}