Skip to content

Commit 1e85379

Browse files
committed
Merge branch 'main' into 847_uninstall-root-certificate-win
2 parents 234fa26 + 25c59ac commit 1e85379

File tree

3 files changed

+237
-161
lines changed

3 files changed

+237
-161
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
# Initializes the CodeQL tools for scanning.
5555
- name: Initialize CodeQL
56-
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
56+
uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
5757
with:
5858
languages: ${{ matrix.language }}
5959
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -81,4 +81,4 @@ jobs:
8181
run: dotnet build --no-restore -c Release
8282

8383
- name: Perform CodeQL Analysis
84-
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
84+
uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19

dev-proxy/Logging/LogEntry.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
}

0 commit comments

Comments
 (0)