Skip to content

Commit

Permalink
Fixing up framework specifiers and adding support for .Net Standard 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Young committed Feb 9, 2016
1 parent f036e16 commit 2fd3810
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Serilog.Sinks.Console/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"frameworks": {
"net45": {
},
"dotnet5.1": {
"dotnet5.3": {
"dependencies": {
"System.Console": "4.0.0-beta-23516"
}
Expand Down
21 changes: 21 additions & 0 deletions src/Serilog/Context/LogContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ public static class LogContext
{
#if ASYNCLOCAL
static readonly AsyncLocal<ImmutableStack<ILogEventEnricher>> Data = new AsyncLocal<ImmutableStack<ILogEventEnricher>>();
#else
#if DOTNET5_1
[ThreadStatic]
static ImmutableStack<ILogEventEnricher> Data;
#else
static readonly string DataSlotName = typeof(LogContext).FullName;
#endif
#endif

/// <summary>
Expand Down Expand Up @@ -151,6 +156,21 @@ static ImmutableStack<ILogEventEnricher> Enrichers
Data.Value = GetContext(value);
}
}
#else

#if DOTNET5_1
static ImmutableStack<ILogEventEnricher> Enrichers
{
get
{
return Data;
}
set
{
Data = GetContext(value);
}
}

#else
static ImmutableStack<ILogEventEnricher> Enrichers
{
Expand Down Expand Up @@ -180,6 +200,7 @@ static ImmutableStack<ILogEventEnricher> Enrichers
}
}
#endif
#endif

#if REMOTING
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dotnet5.1": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
"define": [ "NO_APPDOMAIN" ]
"define": [ "NO_APPDOMAIN", "LOGCONTEXT" ]
},
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
Expand Down

0 comments on commit 2fd3810

Please sign in to comment.