From 2f71498bc5a7778da4625ac3635ae423433d11d0 Mon Sep 17 00:00:00 2001 From: Thibaud Desodt Date: Mon, 16 Oct 2017 07:51:21 +0200 Subject: [PATCH] Get rid of ThreadStaticFieldHasInitializer warnings --- test/TestDummies/DummyRollingFileAuditSink.cs | 2 ++ test/TestDummies/DummyRollingFileSink.cs | 2 ++ test/TestDummies/DummyWithLevelSwitchSink.cs | 2 ++ test/TestDummies/DummyWrappingSink.cs | 4 +++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/TestDummies/DummyRollingFileAuditSink.cs b/test/TestDummies/DummyRollingFileAuditSink.cs index 3a8355a8d..e8618d026 100644 --- a/test/TestDummies/DummyRollingFileAuditSink.cs +++ b/test/TestDummies/DummyRollingFileAuditSink.cs @@ -8,7 +8,9 @@ namespace TestDummies public class DummyRollingFileAuditSink : ILogEventSink { [ThreadStatic] + // ReSharper disable ThreadStaticFieldHasInitializer public static List Emitted = new List(); + // ReSharper restore ThreadStaticFieldHasInitializer public void Emit(LogEvent logEvent) { diff --git a/test/TestDummies/DummyRollingFileSink.cs b/test/TestDummies/DummyRollingFileSink.cs index 5e6bde88b..bc98ed219 100644 --- a/test/TestDummies/DummyRollingFileSink.cs +++ b/test/TestDummies/DummyRollingFileSink.cs @@ -8,7 +8,9 @@ namespace TestDummies public class DummyRollingFileSink : ILogEventSink { [ThreadStatic] + // ReSharper disable ThreadStaticFieldHasInitializer public static List Emitted = new List(); + // ReSharper restore ThreadStaticFieldHasInitializer public void Emit(LogEvent logEvent) { diff --git a/test/TestDummies/DummyWithLevelSwitchSink.cs b/test/TestDummies/DummyWithLevelSwitchSink.cs index 707574ce1..4e1d76fc3 100644 --- a/test/TestDummies/DummyWithLevelSwitchSink.cs +++ b/test/TestDummies/DummyWithLevelSwitchSink.cs @@ -16,7 +16,9 @@ public DummyWithLevelSwitchSink(LoggingLevelSwitch loggingControlLevelSwitch) public static LoggingLevelSwitch ControlLevelSwitch; [ThreadStatic] + // ReSharper disable ThreadStaticFieldHasInitializer public static List Emitted = new List(); + // ReSharper restore ThreadStaticFieldHasInitializer public void Emit(LogEvent logEvent) { diff --git a/test/TestDummies/DummyWrappingSink.cs b/test/TestDummies/DummyWrappingSink.cs index 9d7f96681..cd15d8c33 100644 --- a/test/TestDummies/DummyWrappingSink.cs +++ b/test/TestDummies/DummyWrappingSink.cs @@ -8,7 +8,9 @@ namespace TestDummies public class DummyWrappingSink : ILogEventSink { [ThreadStatic] + // ReSharper disable ThreadStaticFieldHasInitializer public static List Emitted = new List(); + // ReSharper restore ThreadStaticFieldHasInitializer private readonly ILogEventSink _sink; @@ -23,4 +25,4 @@ public void Emit(LogEvent logEvent) _sink.Emit(logEvent); } } -} \ No newline at end of file +}