[CHANGE] Get msgTemplate

This commit is contained in:
max 2024-11-25 18:11:22 +01:00
parent 737cbcfd11
commit 448d85d6f6

View File

@ -23,11 +23,15 @@ public class BasedLogger : Microsoft.Extensions.Logging.ILogger
private LogCapsule ConstructCapsule<TState>(LogSeverity severity, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) private LogCapsule ConstructCapsule<TState>(LogSeverity severity, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{ {
//TODO: Extract parameters & format //TODO: Extract parameters & format
var msgTemplate = string.Empty;
if (state is IEnumerable<KeyValuePair<string, object>> stateEnum) if (state is IEnumerable<KeyValuePair<string, object>> stateEnum)
{ {
foreach (var prop in stateEnum) foreach (var prop in stateEnum)
{ {
if (prop is { Key: "{OriginalFormat}", Value: string propValueString })
{
msgTemplate = propValueString;
}
} }
} }