@@ -32,10 +32,9 @@ static class SurrogateConfigurationMethods
32
32
33
33
/*
34
34
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.
39
38
*/
40
39
41
40
// ReSharper disable UnusedMember.Local
@@ -49,9 +48,7 @@ static LoggerConfiguration Sink(
49
48
ILogEventSink sink ,
50
49
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
51
50
LoggingLevelSwitch levelSwitch = null )
52
- {
53
- return loggerSinkConfiguration . Sink ( sink , restrictedToMinimumLevel , levelSwitch ) ;
54
- }
51
+ => loggerSinkConfiguration . Sink ( sink , restrictedToMinimumLevel , levelSwitch ) ;
55
52
56
53
static LoggerConfiguration Logger (
57
54
LoggerSinkConfiguration loggerSinkConfiguration ,
@@ -67,19 +64,19 @@ static LoggerConfiguration Sink(
67
64
ILogEventSink sink ,
68
65
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
69
66
LoggingLevelSwitch levelSwitch = null )
70
- {
71
- return auditSinkConfiguration . Sink ( sink , restrictedToMinimumLevel , levelSwitch ) ;
72
- }
67
+ => auditSinkConfiguration . Sink ( sink , restrictedToMinimumLevel , levelSwitch ) ;
73
68
74
69
// .Filter...
75
70
// =======
76
71
// TODO: add overload for array argument (ILogEventEnricher[])
72
+ // expose `With(params ILogEventFilter[] filters)` as if it was `With(ILogEventFilter filter)`
77
73
static LoggerConfiguration With ( LoggerFilterConfiguration loggerFilterConfiguration , ILogEventFilter filter )
78
74
=> loggerFilterConfiguration . With ( filter ) ;
79
75
80
76
// .Destructure...
81
77
// ============
82
78
// TODO: add overload for array argument (IDestructuringPolicy[])
79
+ // expose `With(params IDestructuringPolicy[] destructuringPolicies)` as if it was `With(IDestructuringPolicy policy)`
83
80
static LoggerConfiguration With ( LoggerDestructuringConfiguration loggerDestructuringConfiguration , IDestructuringPolicy policy )
84
81
=> loggerDestructuringConfiguration . With ( policy ) ;
85
82
@@ -97,14 +94,15 @@ static LoggerConfiguration AsScalar(LoggerDestructuringConfiguration loggerDestr
97
94
98
95
// .Enrich...
99
96
// =======
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
+
100
103
static LoggerConfiguration FromLogContext ( LoggerEnrichmentConfiguration loggerEnrichmentConfiguration )
101
104
=> loggerEnrichmentConfiguration . FromLogContext ( ) ;
102
105
103
- static LoggerConfiguration With ( LoggerEnrichmentConfiguration loggerEnrichmentConfiguration , ILogEventEnricher enricher )
104
- {
105
- return loggerEnrichmentConfiguration . With ( enricher ) ;
106
- }
107
-
108
106
// ReSharper restore UnusedMember.Local
109
107
}
110
108
}
0 commit comments