From a9923aec3ed051b7450cd7b1b45c68b17a9519e9 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 21 May 2019 17:42:34 +1000 Subject: [PATCH 1/2] Remove some unused build-time constants --- .../Extensions/Logging/SerilogLoggerProvider.cs | 15 +++------------ .../Serilog.Extensions.Logging.csproj | 4 ---- .../SerilogLoggingBuilderExtensions.cs | 4 ---- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs index 3590071..76b32cc 100644 --- a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs +++ b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Threading; using Microsoft.Extensions.Logging; using Serilog.Core; using Serilog.Events; using FrameworkLogger = Microsoft.Extensions.Logging.ILogger; using System.Collections.Generic; +using System.Threading; using Serilog.Context; namespace Serilog.Extensions.Logging @@ -15,9 +15,7 @@ namespace Serilog.Extensions.Logging /// /// An that pipes events through Serilog. /// -#if LOGGING_BUILDER [ProviderAlias("Serilog")] -#endif public class SerilogLoggerProvider : ILoggerProvider, ILogEventEnricher { internal const string OriginalFormatPropertyName = "{OriginalFormat}"; @@ -92,15 +90,8 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) internal SerilogLoggerScope CurrentScope { - get - { - return _value.Value; - } - set - { - _value.Value = value; - } - } + get => _value.Value; + set => _value.Value = value; /// public void Dispose() diff --git a/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj b/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj index 40b882d..479cb20 100644 --- a/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj +++ b/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj @@ -28,8 +28,4 @@ - - $(DefineConstants);ASYNCLOCAL;LOGGING_BUILDER - - diff --git a/src/Serilog.Extensions.Logging/SerilogLoggingBuilderExtensions.cs b/src/Serilog.Extensions.Logging/SerilogLoggingBuilderExtensions.cs index d7a3f5f..27bb6dd 100644 --- a/src/Serilog.Extensions.Logging/SerilogLoggingBuilderExtensions.cs +++ b/src/Serilog.Extensions.Logging/SerilogLoggingBuilderExtensions.cs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if LOGGING_BUILDER - using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -54,5 +52,3 @@ public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder, ILogger l } } } - -#endif // LOGGING_BUILDER From 0885a2a9d126c6c36f6bdb4338847a207deced12 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 21 May 2019 19:33:19 +1000 Subject: [PATCH 2/2] Keyboard fumble --- .../Extensions/Logging/SerilogLoggerProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs index 76b32cc..f4daf8a 100644 --- a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs +++ b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs @@ -92,6 +92,7 @@ internal SerilogLoggerScope CurrentScope { get => _value.Value; set => _value.Value = value; + } /// public void Dispose()