Skip to content

Commit e05fd19

Browse files
Merge branch 'release/0.0.5'
2 parents f885747 + 58c8383 commit e05fd19

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.github/workflows/prerelease.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ name: PreRelease
66
# events but only for the master branch
77
on:
88
push:
9-
branches: [ develop ]
9+
branches:
10+
- develop
1011

1112
env:
1213
next_mode: preminor
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
}

nightly.serilog.xamarin/nightly.serilog.xamarin/EnrichersConfigurationExtensions.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ namespace nightly.serilog.xamarin
1111
public static class EnrichersConfigurationExtensions
1212
{
1313

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+
1426
/// <summary>
1527
/// Add univoque id to device
1628
/// Value is stored in SecureStorage

0 commit comments

Comments
 (0)