mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-08 01:04:47 +00:00
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:
@@ -5,12 +5,7 @@ using Serilog.Core;
|
||||
using Serilog.Events;
|
||||
using Serilog.Formatting;
|
||||
using Serilog.Formatting.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace PepperDash.Core
|
||||
{
|
||||
@@ -26,7 +21,7 @@ namespace PepperDash.Core
|
||||
|
||||
if(logEvent.Properties.TryGetValue("Key",out var value) && value is ScalarValue sv && sv.Value is string rawValue)
|
||||
{
|
||||
message = $"[{logEvent.Timestamp}][{logEvent.Level}][App {InitialParametersClass.ApplicationNumber}][{rawValue}]: {logEvent.RenderMessage()}";
|
||||
message = $"[{logEvent.Timestamp}][{logEvent.Level}][App {InitialParametersClass.ApplicationNumber}][{rawValue,3}]: {logEvent.RenderMessage()}";
|
||||
}
|
||||
|
||||
CrestronConsole.PrintLine(message);
|
||||
|
||||
Reference in New Issue
Block a user