Skip to content

Commit 01b1cfd

Browse files
committed
Minor reformatting and documentation
1 parent a55fc9f commit 01b1cfd

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/Serilog.Settings.Configuration/Settings/Configuration/SurrogateConfigurationMethods.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ static class SurrogateConfigurationMethods
3232

3333
/*
3434
Pass-through calls to various Serilog config methods which are
35-
implemented as instance methods rather than extension methods. The
36-
FindXXXConfigurationMethods calls (above) use these to add method
37-
invocation expressions as surrogates so that SelectConfigurationMethod
38-
has a way to match and invoke these instance methods.
35+
implemented as instance methods rather than extension methods.
36+
ConfigurationReader adds those to the already discovered extension methods
37+
so they can be invoked as well.
3938
*/
4039

4140
// ReSharper disable UnusedMember.Local
@@ -49,9 +48,7 @@ static LoggerConfiguration Sink(
4948
ILogEventSink sink,
5049
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
5150
LoggingLevelSwitch levelSwitch = null)
52-
{
53-
return loggerSinkConfiguration.Sink(sink, restrictedToMinimumLevel, levelSwitch);
54-
}
51+
=> loggerSinkConfiguration.Sink(sink, restrictedToMinimumLevel, levelSwitch);
5552

5653
static LoggerConfiguration Logger(
5754
LoggerSinkConfiguration loggerSinkConfiguration,
@@ -67,19 +64,19 @@ static LoggerConfiguration Sink(
6764
ILogEventSink sink,
6865
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
6966
LoggingLevelSwitch levelSwitch = null)
70-
{
71-
return auditSinkConfiguration.Sink(sink, restrictedToMinimumLevel, levelSwitch);
72-
}
67+
=> auditSinkConfiguration.Sink(sink, restrictedToMinimumLevel, levelSwitch);
7368

7469
// .Filter...
7570
// =======
7671
// TODO: add overload for array argument (ILogEventEnricher[])
72+
// expose `With(params ILogEventFilter[] filters)` as if it was `With(ILogEventFilter filter)`
7773
static LoggerConfiguration With(LoggerFilterConfiguration loggerFilterConfiguration, ILogEventFilter filter)
7874
=> loggerFilterConfiguration.With(filter);
7975

8076
// .Destructure...
8177
// ============
8278
// TODO: add overload for array argument (IDestructuringPolicy[])
79+
// expose `With(params IDestructuringPolicy[] destructuringPolicies)` as if it was `With(IDestructuringPolicy policy)`
8380
static LoggerConfiguration With(LoggerDestructuringConfiguration loggerDestructuringConfiguration, IDestructuringPolicy policy)
8481
=> loggerDestructuringConfiguration.With(policy);
8582

@@ -97,14 +94,15 @@ static LoggerConfiguration AsScalar(LoggerDestructuringConfiguration loggerDestr
9794

9895
// .Enrich...
9996
// =======
97+
// expose `With(params ILogEventEnricher[] enrichers)` as if it was `With(ILogEventEnricher enricher)`
98+
static LoggerConfiguration With(
99+
LoggerEnrichmentConfiguration loggerEnrichmentConfiguration,
100+
ILogEventEnricher enricher)
101+
=> loggerEnrichmentConfiguration.With(enricher);
102+
100103
static LoggerConfiguration FromLogContext(LoggerEnrichmentConfiguration loggerEnrichmentConfiguration)
101104
=> loggerEnrichmentConfiguration.FromLogContext();
102105

103-
static LoggerConfiguration With(LoggerEnrichmentConfiguration loggerEnrichmentConfiguration, ILogEventEnricher enricher)
104-
{
105-
return loggerEnrichmentConfiguration.With(enricher);
106-
}
107-
108106
// ReSharper restore UnusedMember.Local
109107
}
110108
}

0 commit comments

Comments
 (0)