Skip to content

Commit 7ba9559

Browse files
authored
Merge pull request #140 from nblumhardt/remove-constants
Remove some unused build-time constants
2 parents e85c32f + 0885a2a commit 7ba9559

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs

+3-11
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using System.Threading;
65
using Microsoft.Extensions.Logging;
76
using Serilog.Core;
87
using Serilog.Events;
98
using FrameworkLogger = Microsoft.Extensions.Logging.ILogger;
109
using System.Collections.Generic;
10+
using System.Threading;
1111
using Serilog.Context;
1212

1313
namespace Serilog.Extensions.Logging
1414
{
1515
/// <summary>
1616
/// An <see cref="ILoggerProvider"/> that pipes events through Serilog.
1717
/// </summary>
18-
#if LOGGING_BUILDER
1918
[ProviderAlias("Serilog")]
20-
#endif
2119
public class SerilogLoggerProvider : ILoggerProvider, ILogEventEnricher
2220
{
2321
internal const string OriginalFormatPropertyName = "{OriginalFormat}";
@@ -92,14 +90,8 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
9290

9391
internal SerilogLoggerScope CurrentScope
9492
{
95-
get
96-
{
97-
return _value.Value;
98-
}
99-
set
100-
{
101-
_value.Value = value;
102-
}
93+
get => _value.Value;
94+
set => _value.Value = value;
10395
}
10496

10597
/// <inheritdoc />

src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,4 @@
2828
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
2929
</ItemGroup>
3030

31-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
32-
<DefineConstants>$(DefineConstants);ASYNCLOCAL;LOGGING_BUILDER</DefineConstants>
33-
</PropertyGroup>
34-
3531
</Project>

src/Serilog.Extensions.Logging/SerilogLoggingBuilderExtensions.cs

-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#if LOGGING_BUILDER
16-
1715
using System;
1816
using Microsoft.Extensions.DependencyInjection;
1917
using Microsoft.Extensions.Logging;
@@ -54,5 +52,3 @@ public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder, ILogger l
5452
}
5553
}
5654
}
57-
58-
#endif // LOGGING_BUILDER

0 commit comments

Comments
 (0)