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
29
29
}
30
30
31
31
private ILogEventPropertyValueFactory _factory = null ! ;
32
+ private IDestructuringPolicy _policy = null ! ;
32
33
private object _value = null ! ;
33
- private readonly JsonNetDestructuringPolicy _policy = new ( ) ;
34
34
35
35
[ GlobalSetup ]
36
36
public void Setup ( )
@@ -59,6 +59,8 @@ public void Setup()
59
59
var processor = log . GetType ( ) . GetField ( "_messageTemplateProcessor" , System . Reflection . BindingFlags . NonPublic | System . Reflection . BindingFlags . Instance ) ! . GetValue ( log ) ! ;
60
60
var converter = processor . GetType ( ) . GetField ( "_propertyValueConverter" , System . Reflection . BindingFlags . NonPublic | System . Reflection . BindingFlags . Instance ) ! . GetValue ( processor ) ! ;
61
61
_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 ) ;
62
64
}
63
65
64
66
[ Benchmark ]
You can’t perform that action at this time.
0 commit comments