Skip to content

Commit

Permalink
Merge branch 'release/0.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
markjackmilian committed Oct 6, 2021
2 parents f885747 + 58c8383 commit e05fd19
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ name: PreRelease
# events but only for the master branch
on:
push:
branches: [ develop ]
branches:
- develop

env:
next_mode: preminor
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Serilog.Core;
using Serilog.Events;

namespace nightly.serilog.xamarin.Enrichers
{
public class DevelopmentEnricher : ILogEventEnricher
{
private LogEventProperty _cachedProperty;

public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
this._cachedProperty ??= propertyFactory.CreateProperty("Development",true);
logEvent.AddPropertyIfAbsent(this._cachedProperty);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ namespace nightly.serilog.xamarin
public static class EnrichersConfigurationExtensions
{

/// <summary>
/// Add a property Development with value true
/// </summary>
/// <param name="enrichment"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
public static LoggerConfiguration WithDevelopment(this LoggerEnrichmentConfiguration enrichment)
{
if (enrichment == null) throw new ArgumentNullException(nameof(enrichment));
return enrichment.With<DevelopmentEnricher>();
}

/// <summary>
/// Add univoque id to device
/// Value is stored in SecureStorage
Expand Down

0 comments on commit e05fd19

Please sign in to comment.