feat: add method to log Exceptions using default Serilog options

Alos modified console sink to pad non-keyed messages with 3 characters of empty space
This commit is contained in:
Andrew Welker
2024-03-27 11:49:04 -05:00
parent f2f40c7197
commit 99d0b2ea3a
3 changed files with 45 additions and 19 deletions

View File

@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Serilog;
using Serilog.Core;
using Serilog.Sinks.SystemConsole;
using Serilog.Events;
namespace PepperDash.Core
{
@@ -53,7 +50,7 @@ namespace PepperDash.Core
public Device(string key)
{
Key = key;
if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
if (key.Contains('.')) Debug.LogMessage(LogEventLevel.Information, "WARNING: Device key should not include '.'", this);
Name = "";
}