[CHANGE] Get msgTemplate
This commit is contained in:
parent
737cbcfd11
commit
448d85d6f6
1 changed files with 5 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue