Skip to content

Commit 5b2ce01

Browse files
committed
Update to Serilog 4
1 parent 71d1978 commit 5b2ce01

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
4343
var threadId = Environment.CurrentManagedThreadId;
4444

4545
var last = _lastValue;
46-
if (last == null || (int)((ScalarValue)last.Value).Value != threadId)
46+
if (last is null || (int)((ScalarValue)last.Value).Value! != threadId)
4747
// no need to synchronize threads on write - just some of them will win
4848
_lastValue = last = new LogEventProperty(ThreadIdPropertyName, new ScalarValue(threadId));
4949

src/Serilog.Enrichers.Thread/Enrichers/ThreadNameEnricher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ public class ThreadNameEnricher : ILogEventEnricher
4141
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
4242
{
4343
var threadName = Thread.CurrentThread.Name;
44-
if (threadName != null)
44+
if (threadName is not null)
4545
{
4646
var last = _lastValue;
47-
if (last == null || (string)((ScalarValue)last.Value).Value != threadName)
47+
if (last is null || (string)((ScalarValue)last.Value).Value! != threadName)
4848
// no need to synchronize threads on write - just some of them will win
4949
_lastValue = last = new LogEventProperty(ThreadNamePropertyName, new ScalarValue(threadName));
5050

src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Serilog" Version="2.9.0" />
30+
<PackageReference Include="Serilog" Version="4.0.0" />
3131
</ItemGroup>
3232

3333
<ItemGroup>

0 commit comments

Comments
 (0)