mirror of
https://github.com/hmaxnl/DotBased.git
synced 2025-01-18 18:14:20 +01:00
[CHANGE] Get msgTemplate
This commit is contained in:
parent
737cbcfd11
commit
448d85d6f6
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user