Skip to content

Commit

Permalink
Get rid of ThreadStaticFieldHasInitializer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tsimbalar committed Oct 16, 2017
1 parent af0d217 commit 2f71498
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/TestDummies/DummyRollingFileAuditSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ namespace TestDummies
public class DummyRollingFileAuditSink : ILogEventSink
{
[ThreadStatic]
// ReSharper disable ThreadStaticFieldHasInitializer
public static List<LogEvent> Emitted = new List<LogEvent>();
// ReSharper restore ThreadStaticFieldHasInitializer

public void Emit(LogEvent logEvent)
{
Expand Down
2 changes: 2 additions & 0 deletions test/TestDummies/DummyRollingFileSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ namespace TestDummies
public class DummyRollingFileSink : ILogEventSink
{
[ThreadStatic]
// ReSharper disable ThreadStaticFieldHasInitializer
public static List<LogEvent> Emitted = new List<LogEvent>();
// ReSharper restore ThreadStaticFieldHasInitializer

public void Emit(LogEvent logEvent)
{
Expand Down
2 changes: 2 additions & 0 deletions test/TestDummies/DummyWithLevelSwitchSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public DummyWithLevelSwitchSink(LoggingLevelSwitch loggingControlLevelSwitch)
public static LoggingLevelSwitch ControlLevelSwitch;

[ThreadStatic]
// ReSharper disable ThreadStaticFieldHasInitializer
public static List<LogEvent> Emitted = new List<LogEvent>();
// ReSharper restore ThreadStaticFieldHasInitializer

public void Emit(LogEvent logEvent)
{
Expand Down
4 changes: 3 additions & 1 deletion test/TestDummies/DummyWrappingSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ namespace TestDummies
public class DummyWrappingSink : ILogEventSink
{
[ThreadStatic]
// ReSharper disable ThreadStaticFieldHasInitializer
public static List<LogEvent> Emitted = new List<LogEvent>();
// ReSharper restore ThreadStaticFieldHasInitializer

private readonly ILogEventSink _sink;

Expand All @@ -23,4 +25,4 @@ public void Emit(LogEvent logEvent)
_sink.Emit(logEvent);
}
}
}
}

0 comments on commit 2f71498

Please sign in to comment.