File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Serilog.Extensions.Logging.Benchmarks
Serilog.Extensions.Logging.Tests Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1212 <ItemGroup >
1313 <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.5.0" />
1414 <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.5" PrivateAssets =" All" />
15- <PackageReference Include =" xunit" Version =" 2.4.2 " />
15+ <PackageReference Include =" xunit" Version =" 2.5.1 " />
1616 <PackageReference Include =" BenchmarkDotNet" Version =" 0.13.5" />
1717 </ItemGroup >
1818
Original file line number Diff line number Diff line change 44 <TargetFrameworks >net7.0;net472</TargetFrameworks >
55 <ImplicitUsings >enable</ImplicitUsings >
66 </PropertyGroup >
7+
8+ <PropertyGroup Condition =" '$(TargetFramework) == 'net472' " >
9+ <DefineConstants >$(DefineConstants);FORCE_W3C_ACTIVITY_ID</DefineConstants >
10+ </PropertyGroup >
711
812 <ItemGroup >
913 <ProjectReference Include =" ..\..\src\Serilog.Extensions.Logging\Serilog.Extensions.Logging.csproj" />
1216 <ItemGroup >
1317 <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.5.0" />
1418 <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.5" PrivateAssets =" all" />
15- <PackageReference Include =" xunit" Version =" 2.4.2 " />
19+ <PackageReference Include =" xunit" Version =" 2.5.1 " />
1620 <PackageReference Include =" Shouldly" Version =" 4.1.0" />
1721 <PackageReference Include =" PublicApiGenerator" Version =" 11.0.0" />
1822 </ItemGroup >
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ public void LogsCorrectMessage()
143143
144144 Assert . Equal ( 3 , sink . Writes . Count ) ;
145145
146- Assert . Equal ( 1 , sink . Writes [ 0 ] . Properties . Count ) ;
146+ Assert . Single ( sink . Writes [ 0 ] . Properties ) ;
147147 Assert . Empty ( sink . Writes [ 0 ] . RenderMessage ( ) ) ;
148148
149149 Assert . Equal ( 2 , sink . Writes [ 1 ] . Properties . Count ) ;
@@ -501,6 +501,11 @@ public void Emit(LogEvent logEvent)
501501 [ Fact ]
502502 public void TraceAndSpanIdsAreCaptured ( )
503503 {
504+ #if FORCE_W3C_ACTIVITY_ID
505+ Activity . DefaultIdFormat = ActivityIdFormat . W3C ;
506+ Activity . ForceDefaultIdFormat = true ;
507+ #endif
508+
504509 using var listener = new ActivityListener ( ) ;
505510 listener . ShouldListenTo = _ => true ;
506511 listener . Sample = ( ref ActivityCreationOptions < ActivityContext > _ ) => ActivitySamplingResult . AllData ;
You can’t perform that action at this time.
0 commit comments