File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
nightly.serilog.xamarin/nightly.serilog.xamarin Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ name: PreRelease
6
6
# events but only for the master branch
7
7
on :
8
8
push :
9
- branches : [ develop ]
9
+ branches :
10
+ - develop
10
11
11
12
env :
12
13
next_mode : preminor
Original file line number Diff line number Diff line change
1
+ using Serilog . Core ;
2
+ using Serilog . Events ;
3
+
4
+ namespace nightly . serilog . xamarin . Enrichers
5
+ {
6
+ public class DevelopmentEnricher : ILogEventEnricher
7
+ {
8
+ private LogEventProperty _cachedProperty ;
9
+
10
+ public void Enrich ( LogEvent logEvent , ILogEventPropertyFactory propertyFactory )
11
+ {
12
+ this . _cachedProperty ??= propertyFactory . CreateProperty ( "Development" , true ) ;
13
+ logEvent . AddPropertyIfAbsent ( this . _cachedProperty ) ;
14
+ }
15
+ }
16
+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,18 @@ namespace nightly.serilog.xamarin
11
11
public static class EnrichersConfigurationExtensions
12
12
{
13
13
14
+ /// <summary>
15
+ /// Add a property Development with value true
16
+ /// </summary>
17
+ /// <param name="enrichment"></param>
18
+ /// <returns></returns>
19
+ /// <exception cref="ArgumentNullException"></exception>
20
+ public static LoggerConfiguration WithDevelopment ( this LoggerEnrichmentConfiguration enrichment )
21
+ {
22
+ if ( enrichment == null ) throw new ArgumentNullException ( nameof ( enrichment ) ) ;
23
+ return enrichment . With < DevelopmentEnricher > ( ) ;
24
+ }
25
+
14
26
/// <summary>
15
27
/// Add univoque id to device
16
28
/// Value is stored in SecureStorage
You can’t perform that action at this time.
0 commit comments