Skip to content

Commit

Permalink
Moving PermitCrossAppDomainCalls inside REMOTING #ifdef.
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Young committed Jan 29, 2016
1 parent 4e9c2a3 commit 09afb78
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Serilog/Context/LogContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ public static class LogContext
static readonly string DataSlotName = typeof(LogContext).FullName;
#endif

/// <summary>
/// When calling into appdomains without Serilog loaded, e.g. via remoting or during unit testing,
/// it may be necesary to set this value to true so that serialization exceptions are avoided. When possible,
/// using the <see cref="Suspend"/> method in a using block around the call has a lower overhead and
/// should be preferred.
/// </summary>
public static bool PermitCrossAppDomainCalls { get; set; }

/// <summary>
/// Push a property onto the context, returning an <see cref="IDisposable"/>
/// that can later be used to remove the property, along with any others that
Expand Down Expand Up @@ -190,6 +182,14 @@ static ImmutableStack<ILogEventEnricher> Enrichers
#endif

#if REMOTING
/// <summary>
/// When calling into appdomains without Serilog loaded, e.g. via remoting or during unit testing,
/// it may be necesary to set this value to true so that serialization exceptions are avoided. When possible,
/// using the <see cref="Suspend"/> method in a using block around the call has a lower overhead and
/// should be preferred.
/// </summary>
public static bool PermitCrossAppDomainCalls { get; set; }

static object GetContext(ImmutableStack<ILogEventEnricher> value)
{
var context = !PermitCrossAppDomainCalls ? (object) value : new Wrapper
Expand Down

0 comments on commit 09afb78

Please sign in to comment.