Skip to content

Commit 2426487

Browse files
committed
Reformat / light refactor in ConfigurationReader
renamed a variable and reindented properly
1 parent c5731c9 commit 2426487

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ void ApplyFilters(LoggerConfiguration loggerConfiguration, IReadOnlyDictionary<s
155155

156156
void ApplyDestructuring(LoggerConfiguration loggerConfiguration, IReadOnlyDictionary<string, LoggingLevelSwitch> declaredLevelSwitches)
157157
{
158-
var filterDirective = _section.GetSection("Destructure");
159-
if(filterDirective.GetChildren().Any())
158+
var destructureDirective = _section.GetSection("Destructure");
159+
if (destructureDirective.GetChildren().Any())
160160
{
161-
var methodCalls = GetMethodCalls(filterDirective);
161+
var methodCalls = GetMethodCalls(destructureDirective);
162162
CallConfigurationMethods(methodCalls, FindDestructureConfigurationMethods(_configurationAssemblies), loggerConfiguration.Destructure, declaredLevelSwitches);
163163
}
164164
}
@@ -221,9 +221,11 @@ internal ILookup<string, Dictionary<string, IConfigurationArgumentValue>> GetMet
221221
where child.Value == null
222222
let name = GetSectionName(child)
223223
let callArgs = (from argument in child.GetSection("Args").GetChildren()
224-
select new {
224+
select new
225+
{
225226
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)
227229
select new { Name = name, Args = callArgs }))
228230
.ToLookup(p => p.Name, p => p.Args);
229231

@@ -330,7 +332,7 @@ static void CallConfigurationMethods(ILookup<string, Dictionary<string, IConfigu
330332
select directive.Key == null ? p.DefaultValue : directive.Value.ConvertTo(p.ParameterType, declaredLevelSwitches)).ToList();
331333

332334
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;
334336

335337
call.Insert(0, receiver);
336338

@@ -376,7 +378,7 @@ internal static IList<MethodInfo> FindFilterConfigurationMethods(IReadOnlyCollec
376378
internal static IList<MethodInfo> FindDestructureConfigurationMethods(IReadOnlyCollection<Assembly> configurationAssemblies)
377379
{
378380
var found = FindConfigurationExtensionMethods(configurationAssemblies, typeof(LoggerDestructuringConfiguration));
379-
if(configurationAssemblies.Contains(typeof(LoggerDestructuringConfiguration).GetTypeInfo().Assembly))
381+
if (configurationAssemblies.Contains(typeof(LoggerDestructuringConfiguration).GetTypeInfo().Assembly))
380382
{
381383
found.Add(GetSurrogateConfigurationMethod<LoggerDestructuringConfiguration, IDestructuringPolicy, object>((c, d, _) => With(c, d)));
382384
found.Add(GetSurrogateConfigurationMethod<LoggerDestructuringConfiguration, int, object>((c, m, _) => ToMaximumDepth(c, m)));

0 commit comments

Comments
 (0)