@@ -62,11 +62,7 @@ public class TestWrapperLogger(ILogger toWrap) : ILogger
6262 public int LogCount = 0 ;
6363 private ILogger Inner { get ; } = toWrap ;
6464
65- #if NET8_0_OR_GREATER
6665 public IDisposable ? BeginScope < TState > ( TState state ) where TState : notnull => Inner . BeginScope ( state ) ;
67- #else
68- public IDisposable BeginScope < TState > ( TState state ) => Inner . BeginScope ( state ) ;
69- #endif
7066 public bool IsEnabled ( LogLevel logLevel ) => Inner . IsEnabled ( logLevel ) ;
7167 public void Log < TState > ( LogLevel logLevel , EventId eventId , TState state , Exception ? exception , Func < TState , Exception ? , string > formatter )
7268 {
@@ -80,11 +76,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
8076 /// </summary>
8177 private sealed class TestMultiLogger ( params ILogger [ ] loggers ) : ILogger
8278 {
83- #if NET8_0_OR_GREATER
8479 public IDisposable ? BeginScope < TState > ( TState state ) where TState : notnull => null ;
85- #else
86- public IDisposable BeginScope < TState > ( TState state ) => null ! ;
87- #endif
8880 public bool IsEnabled ( LogLevel logLevel ) => true ;
8981 public void Log < TState > ( LogLevel logLevel , EventId eventId , TState state , Exception ? exception , Func < TState , Exception ? , string > formatter )
9082 {
@@ -104,11 +96,7 @@ private sealed class TestLogger : ILogger
10496 public TestLogger ( LogLevel logLevel , TextWriter output ) =>
10597 ( _logLevel , _output ) = ( logLevel , output ) ;
10698
107- #if NET8_0_OR_GREATER
10899 public IDisposable ? BeginScope < TState > ( TState state ) where TState : notnull => null ;
109- #else
110- public IDisposable BeginScope < TState > ( TState state ) => null ! ;
111- #endif
112100 public bool IsEnabled ( LogLevel logLevel ) => logLevel >= _logLevel ;
113101 public void Log < TState > ( LogLevel logLevel , EventId eventId , TState state , Exception ? exception , Func < TState , Exception ? , string > formatter )
114102 {
0 commit comments