From f51900f452ea9f76e9031862d0f2bc49adda60e1 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Sun, 12 Nov 2023 11:12:21 +0000 Subject: [PATCH] Enable nullability annotations in the project --- src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs | 2 +- src/Serilog.Enrichers.Thread/Enrichers/ThreadNameEnricher.cs | 2 +- src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.csproj | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs b/src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs index a19dc94..2ad07e5 100644 --- a/src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs +++ b/src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs @@ -31,7 +31,7 @@ public class ThreadIdEnricher : ILogEventEnricher /// /// The cached last created "ThreadId" property with some thread id. It is likely to be reused frequently so avoiding heap allocations. /// - private LogEventProperty _lastValue; + private LogEventProperty? _lastValue; /// /// Enrich the log event. diff --git a/src/Serilog.Enrichers.Thread/Enrichers/ThreadNameEnricher.cs b/src/Serilog.Enrichers.Thread/Enrichers/ThreadNameEnricher.cs index cffa6c0..d9b8cf4 100644 --- a/src/Serilog.Enrichers.Thread/Enrichers/ThreadNameEnricher.cs +++ b/src/Serilog.Enrichers.Thread/Enrichers/ThreadNameEnricher.cs @@ -32,7 +32,7 @@ public class ThreadNameEnricher : ILogEventEnricher /// /// The cached last created "ThreadName" property with some thread name. It is likely to be reused frequently so avoiding heap allocations. /// - private LogEventProperty _lastValue; + private LogEventProperty? _lastValue; /// /// Enrich the log event. diff --git a/src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.csproj b/src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.csproj index a9bd8d6..aa25c84 100644 --- a/src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.csproj +++ b/src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.csproj @@ -17,6 +17,8 @@ http://serilog.net Apache-2.0 false + latest + enable