From c1f4994221f2713555cc9f191aef39693b6a3fb6 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Sat, 6 Jul 2019 14:02:44 +0300 Subject: [PATCH] This is version 1.1.1. Avoid creating a TaskLoggingHelper if not needed. This also brings better integration with the task, like its Log.HasLoggedErrors property works on top of Serilog. --- Serilog.Sinks.MSBuild/MSBuildSink.cs | 2 +- Serilog.Sinks.MSBuild/Serilog.Sinks.MSBuild.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Serilog.Sinks.MSBuild/MSBuildSink.cs b/Serilog.Sinks.MSBuild/MSBuildSink.cs index b454e66..f170fdc 100644 --- a/Serilog.Sinks.MSBuild/MSBuildSink.cs +++ b/Serilog.Sinks.MSBuild/MSBuildSink.cs @@ -76,7 +76,7 @@ public class MSBuildSink : ILogEventSink public MSBuildSink(ITask task, IFormatProvider formatProvider = null) { _formatProvider = formatProvider; - _loggingHelper = new TaskLoggingHelper(task); + _loggingHelper = task is Task taskConcrete ? taskConcrete.Log : new TaskLoggingHelper(task); } /// diff --git a/Serilog.Sinks.MSBuild/Serilog.Sinks.MSBuild.csproj b/Serilog.Sinks.MSBuild/Serilog.Sinks.MSBuild.csproj index 5eef50f..f685685 100644 --- a/Serilog.Sinks.MSBuild/Serilog.Sinks.MSBuild.csproj +++ b/Serilog.Sinks.MSBuild/Serilog.Sinks.MSBuild.csproj @@ -1,7 +1,7 @@  - 1.1.0 + 1.1.1 net45;netstandard2.0 Serilog sink for MSBuild Theodore Tsirpanis @@ -12,7 +12,7 @@ It is useful when an MSBuild task calls code that uses Serilog. https://serilog.net/images/serilog-sink-nuget.png https://github.com/teo-tsirpanis/serilog-sinks-msbuild - Add deeper integration with MSBuild. + Avoid creating a TaskLoggingHelper if not needed. true true true