File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ private class HasName
2929 }
3030
3131 private ILogEventPropertyValueFactory _factory = null ! ;
32+ private IDestructuringPolicy _policy = null ! ;
3233 private object _value = null ! ;
33- private readonly JsonNetDestructuringPolicy _policy = new ( ) ;
3434
3535 [ GlobalSetup ]
3636 public void Setup ( )
@@ -59,6 +59,8 @@ public void Setup()
5959 var processor = log . GetType ( ) . GetField ( "_messageTemplateProcessor" , System . Reflection . BindingFlags . NonPublic | System . Reflection . BindingFlags . Instance ) ! . GetValue ( log ) ! ;
6060 var converter = processor . GetType ( ) . GetField ( "_propertyValueConverter" , System . Reflection . BindingFlags . NonPublic | System . Reflection . BindingFlags . Instance ) ! . GetValue ( processor ) ! ;
6161 _factory = ( ILogEventPropertyValueFactory ) converter ;
62+ var policies = ( IDestructuringPolicy [ ] ) converter . GetType ( ) . GetField ( "_destructuringPolicies" , System . Reflection . BindingFlags . NonPublic | System . Reflection . BindingFlags . Instance ) ! . GetValue ( converter ) ! ;
63+ _policy = policies . First ( p => p is JsonNetDestructuringPolicy ) ;
6264 }
6365
6466 [ Benchmark ]
You can’t perform that action at this time.
0 commit comments