@@ -155,10 +155,10 @@ void ApplyFilters(LoggerConfiguration loggerConfiguration, IReadOnlyDictionary<s
155
155
156
156
void ApplyDestructuring ( LoggerConfiguration loggerConfiguration , IReadOnlyDictionary < string , LoggingLevelSwitch > declaredLevelSwitches )
157
157
{
158
- var filterDirective = _section . GetSection ( "Destructure" ) ;
159
- if ( filterDirective . GetChildren ( ) . Any ( ) )
158
+ var destructureDirective = _section . GetSection ( "Destructure" ) ;
159
+ if ( destructureDirective . GetChildren ( ) . Any ( ) )
160
160
{
161
- var methodCalls = GetMethodCalls ( filterDirective ) ;
161
+ var methodCalls = GetMethodCalls ( destructureDirective ) ;
162
162
CallConfigurationMethods ( methodCalls , FindDestructureConfigurationMethods ( _configurationAssemblies ) , loggerConfiguration . Destructure , declaredLevelSwitches ) ;
163
163
}
164
164
}
@@ -221,9 +221,11 @@ internal ILookup<string, Dictionary<string, IConfigurationArgumentValue>> GetMet
221
221
where child . Value == null
222
222
let name = GetSectionName ( child )
223
223
let callArgs = ( from argument in child . GetSection ( "Args" ) . GetChildren ( )
224
- select new {
224
+ select new
225
+ {
225
226
Name = argument . Key ,
226
- Value = GetArgumentValue ( argument ) } ) . ToDictionary ( p => p . Name , p => p . Value )
227
+ Value = GetArgumentValue ( argument )
228
+ } ) . ToDictionary ( p => p . Name , p => p . Value )
227
229
select new { Name = name , Args = callArgs } ) )
228
230
. ToLookup ( p => p . Name , p => p . Args ) ;
229
231
@@ -330,7 +332,7 @@ static void CallConfigurationMethods(ILookup<string, Dictionary<string, IConfigu
330
332
select directive . Key == null ? p . DefaultValue : directive . Value . ConvertTo ( p . ParameterType , declaredLevelSwitches ) ) . ToList ( ) ;
331
333
332
334
var parm = methodInfo . GetParameters ( ) . FirstOrDefault ( i => i . ParameterType == typeof ( IConfiguration ) ) ;
333
- if ( parm != null ) call [ parm . Position - 1 ] = _configuration ;
335
+ if ( parm != null ) call [ parm . Position - 1 ] = _configuration ;
334
336
335
337
call . Insert ( 0 , receiver ) ;
336
338
@@ -376,7 +378,7 @@ internal static IList<MethodInfo> FindFilterConfigurationMethods(IReadOnlyCollec
376
378
internal static IList < MethodInfo > FindDestructureConfigurationMethods ( IReadOnlyCollection < Assembly > configurationAssemblies )
377
379
{
378
380
var found = FindConfigurationExtensionMethods ( configurationAssemblies , typeof ( LoggerDestructuringConfiguration ) ) ;
379
- if ( configurationAssemblies . Contains ( typeof ( LoggerDestructuringConfiguration ) . GetTypeInfo ( ) . Assembly ) )
381
+ if ( configurationAssemblies . Contains ( typeof ( LoggerDestructuringConfiguration ) . GetTypeInfo ( ) . Assembly ) )
380
382
{
381
383
found . Add ( GetSurrogateConfigurationMethod < LoggerDestructuringConfiguration , IDestructuringPolicy , object > ( ( c , d , _ ) => With ( c , d ) ) ) ;
382
384
found . Add ( GetSurrogateConfigurationMethod < LoggerDestructuringConfiguration , int , object > ( ( c , m , _ ) => ToMaximumDepth ( c , m ) ) ) ;
0 commit comments