Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit b51ea12

Browse files
committed
Updated Logger to 5.0.0
1 parent d3b0e38 commit b51ea12

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.11" />
1616
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.11" />
1717

18-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="3.1.11" />
19-
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="3.1.11" />
18+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="5.0.0" />
19+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
2020

2121
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="3.2.4" />
2222
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />

Tests/LinqToDB.EntityFrameworkCore.BaseTests/Logging/TestLogger.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
6060

6161
public virtual void WriteMessage(LogLevel logLevel, string logName, int eventId, string message, Exception exception)
6262
{
63-
var format = Options!.Format;
64-
Debug.Assert(format >= ConsoleLoggerFormat.Default && format <= ConsoleLoggerFormat.Systemd);
63+
var format = Options!.FormatterName;
64+
Debug.Assert(format is ConsoleFormatterNames.Simple or ConsoleFormatterNames.Systemd);
6565

6666
var logBuilder = _logBuilder;
6767
_logBuilder = null;
@@ -72,11 +72,11 @@ public virtual void WriteMessage(LogLevel logLevel, string logName, int eventId,
7272
}
7373

7474
LogMessageEntry entry;
75-
if (format == ConsoleLoggerFormat.Default)
75+
if (format == ConsoleFormatterNames.Simple)
7676
{
7777
entry = CreateDefaultLogMessage(logBuilder, logLevel, logName, eventId, message, exception);
7878
}
79-
else if (format == ConsoleLoggerFormat.Systemd)
79+
else if (format == ConsoleFormatterNames.Systemd)
8080
{
8181
entry = CreateSystemdLogMessage(logBuilder, logLevel, logName, eventId, message, exception);
8282
}

Tests/LinqToDB.EntityFrameworkCore.BaseTests/TestUtils.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using LinqToDB.EntityFrameworkCore.BaseTests.Logging;
22
using Microsoft.Extensions.Logging;
3+
using Microsoft.Extensions.Logging.Console;
34

45
namespace LinqToDB.EntityFrameworkCore.BaseTests
56
{
@@ -12,7 +13,10 @@ public class TestUtils
1213
.AddFilter("System", LogLevel.Warning)
1314
.AddFilter("LinqToDB.EntityFrameworkCore.Test", LogLevel.Information)
1415

15-
.AddTestLogger();
16+
.AddTestLogger(o =>
17+
{
18+
o.FormatterName = ConsoleFormatterNames.Simple;
19+
});
1620
});
1721

1822
}

0 commit comments

Comments
 (0)