@@ -379,7 +379,7 @@ public void CleanMethodNamesOfAnonymousDelegatesTest()
379379{
380380var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
381381 <nlog>
382- <targets><target name='debug' type='Debug' layout='${callsite:ClassName=false:CleanNamesOfAnonymousDelegates=true }' /></targets>
382+ <targets><target name='debug' type='Debug' layout='${callsite:ClassName=false}' /></targets>
383383 <rules>
384384 <logger name='*' levels='Fatal' writeTo='debug' />
385385 </rules>
@@ -407,54 +407,12 @@ public void CleanMethodNamesOfAnonymousDelegatesTest()
407407}
408408}
409409
410- [ Fact ]
411- public void DontCleanMethodNamesOfAnonymousDelegatesTest ( )
412- {
413- #if! NETFRAMEWORK
414- if ( IsLinux ( ) )
415- {
416- Console . WriteLine ( "[SKIP] DontCleanMethodNamesOfAnonymousDelegatesTest because unstable with NET8" ) ;
417- return ;
418- }
419- #endif
420-
421- var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
422- <nlog>
423- <targets><target name='debug' type='Debug' layout='${callsite:ClassName=false:CleanNamesOfAnonymousDelegates=false}' /></targets>
424- <rules>
425- <logger name='*' levels='Fatal' writeTo='debug' />
426- </rules>
427- </nlog>" ) . LogFactory ;
428-
429- var logger = logFactory . GetLogger ( "A" ) ;
430-
431- bool done = false ;
432- ThreadPool . QueueUserWorkItem (
433- state=>
434- {
435- logger . Fatal ( "message" ) ;
436- done = true ;
437- } ,
438- null ) ;
439-
440- while ( done == false )
441- {
442- Thread . Sleep ( 10 ) ;
443- }
444-
445- if ( done == true )
446- {
447- string lastMessage = GetDebugLastMessage ( "debug" , logFactory ) ;
448- Assert . StartsWith ( "<DontCleanMethodNamesOfAnonymousDelegatesTest>" , lastMessage ) ;
449- }
450- }
451-
452410[ Fact ]
453411public void CleanClassNamesOfAnonymousDelegatesTest ( )
454412{
455413var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
456414 <nlog>
457- <targets><target name='debug' type='Debug' layout='${callsite:ClassName=true:MethodName=false:CleanNamesOfAnonymousDelegates=true }' /></targets>
415+ <targets><target name='debug' type='Debug' layout='${callsite:ClassName=true:MethodName=false}' /></targets>
458416 <rules>
459417 <logger name='*' levels='Fatal' writeTo='debug' />
460418 </rules>
@@ -482,53 +440,12 @@ public void CleanClassNamesOfAnonymousDelegatesTest()
482440}
483441}
484442
485- [ Fact ]
486- public void DontCleanClassNamesOfAnonymousDelegatesTest ( )
487- {
488- #if! NETFRAMEWORK
489- if ( IsLinux ( ) )
490- {
491- Console . WriteLine ( "[SKIP] DontCleanClassNamesOfAnonymousDelegatesTest because unstable with NET8" ) ;
492- return ;
493- }
494- #endif
495-
496- var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
497- <nlog>
498- <targets><target name='debug' type='Debug' layout='${callsite:ClassName=true:MethodName=false:CleanNamesOfAnonymousDelegates=false}' /></targets>
499- <rules>
500- <logger name='*' levels='Fatal' writeTo='debug' />
501- </rules>
502- </nlog>" ) . LogFactory ;
503-
504- var logger = logFactory . GetLogger ( "A" ) ;
505-
506- bool done = false ;
507- ThreadPool . QueueUserWorkItem (
508- state=>
509- {
510- logger . Fatal ( "message" ) ;
511- done = true ;
512- } ,
513- null ) ;
514-
515- while ( done == false )
516- {
517- Thread . Sleep ( 10 ) ;
518- }
519-
520- if ( done == true )
521- {
522- logFactory . AssertDebugLastMessageContains ( "+<>" ) ;
523- }
524- }
525-
526443[ Fact ]
527444public void When_NotIncludeNameSpace_Then_CleanAnonymousDelegateClassNameShouldReturnParentClassName ( )
528445{
529446var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
530447 <nlog>
531- <targets><target name='debug' type='Debug' layout='${callsite:ClassName=true:MethodName=false:IncludeNamespace=false:CleanNamesOfAnonymousDelegates=true }' /></targets>
448+ <targets><target name='debug' type='Debug' layout='${callsite:ClassName=true:MethodName=false:IncludeNamespace=false}' /></targets>
532449 <rules>
533450 <logger name='*' levels='Fatal' writeTo='debug' />
534451 </rules>
@@ -1247,7 +1164,7 @@ public void LogAfterTaskRunAwait_CleanNamesOfAsyncContinuationsIsTrue_ShouldClea
12471164
12481165var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
12491166 <nlog>
1250- <targets><target name='debug' type='Debug' layout='${callsite:classname=false:cleannamesofasynccontinuations=true }' /></targets>
1167+ <targets><target name='debug' type='Debug' layout='${callsite:classname=false}' /></targets>
12511168 <rules>
12521169 <logger name='*' levels='Debug' writeTo='debug' />
12531170 </rules>
@@ -1277,7 +1194,7 @@ public void LogAfterTaskRunAwait_CleanNamesOfAsyncContinuationsIsTrue_ShouldClea
12771194
12781195var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
12791196 <nlog>
1280- <targets><target name='debug' type='Debug' layout='${callsite:classname=true:includenamespace=true:cleannamesofasynccontinuations=true:cleanNamesOfAnonymousDelegates=true }' /></targets>
1197+ <targets><target name='debug' type='Debug' layout='${callsite:classname=true:includenamespace=true}' /></targets>
12811198 <rules>
12821199 <logger name='*' levels='Debug' writeTo='debug' />
12831200 </rules>
@@ -1299,42 +1216,6 @@ public void LogAfterTaskRunAwait_CleanNamesOfAsyncContinuationsIsTrue_ShouldClea
12991216logFactory . AssertDebugLastMessage ( $ "{ typeof ( InnerClassAsyncMethod6 ) . ToString ( ) } .AsyncMethod6b") ;
13001217}
13011218
1302- #ifNET35
1303- [ Fact ( Skip = "NET35 not supporting async callstack" ) ]
1304- #elifMONO
1305- [ Fact ( Skip = "Not working under MONO - not sure if unit test is wrong, or the code" ) ]
1306- #else
1307- [ Fact ]
1308- #endif
1309- public void LogAfterTaskRunAwait_CleanNamesOfAsyncContinuationsIsFalse_ShouldNotCleanNames ( )
1310- {
1311- #if! NETFRAMEWORK
1312- if ( IsLinux ( ) )
1313- {
1314- Console . WriteLine ( "[SKIP] LogAfterTaskRunAwait_CleanNamesOfAsyncContinuationsIsFalse_ShouldNotCleanNames because unstable with NET8" ) ;
1315- return ;
1316- }
1317- #endif
1318-
1319- var logFactory = new LogFactory ( ) . Setup ( ) . LoadConfigurationFromXml ( @"
1320- <nlog>
1321- <targets><target name='debug' type='Debug' layout='${callsite:includenamespace=true:cleannamesofasynccontinuations=false}' /></targets>
1322- <rules>
1323- <logger name='*' levels='Debug' writeTo='debug' />
1324- </rules>
1325- </nlog>" ) . LogFactory ;
1326-
1327- Task . Run ( async ( ) =>
1328- {
1329- await AMinimalAsyncMethod ( ) ;
1330- var logger = logFactory . GetCurrentClassLogger ( ) ;
1331- logger . Debug ( "dude" ) ;
1332- } ) . Wait ( ) ;
1333-
1334- logFactory . AssertDebugLastMessageContains ( "NLog.UnitTests.LayoutRenderers.CallSiteTests" ) ;
1335- logFactory . AssertDebugLastMessageContains ( "MoveNext" ) ;
1336- }
1337-
13381219private class InnerClassAsyncMethod6
13391220{
13401221public virtual async Task AsyncMethod6a ( LogFactory logFactory )