File tree Expand file tree Collapse file tree 2 files changed +235
-159
lines changed Expand file tree Collapse file tree 2 files changed +235
-159
lines changed Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the MIT license.
3+ // See the LICENSE file in the project root for more information.
4+
5+ using Microsoft . Extensions . Logging . Abstractions ;
6+
7+ namespace DevProxy . Logging ;
8+
9+ readonly struct LogEntry
10+ {
11+ public LogLevel LogLevel { get ; init ; }
12+ public string Category { get ; init ; }
13+ public EventId EventId { get ; init ; }
14+ public string ? Message { get ; init ; }
15+ public Exception ? Exception { get ; init ; }
16+
17+ public static LogEntry FromLogEntry < TState > ( LogEntry < TState > logEntry )
18+ {
19+ return new ( )
20+ {
21+ LogLevel = logEntry . LogLevel ,
22+ Category = logEntry . Category ,
23+ EventId = logEntry . EventId ,
24+ Message = logEntry . Formatter ( logEntry . State , logEntry . Exception ) ,
25+ Exception = logEntry . Exception
26+ } ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments