Skip to content

Commit c66e15b

Browse files
authored
Merge pull request #5 from serilog/dev
1.0.1 Release
2 parents 430df84 + 4efaefb commit c66e15b

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<PropertyGroup>
44
<Description>A Serilog sink that writes log events to the debug output window.</Description>
5-
<VersionPrefix>1.0.0</VersionPrefix>
5+
<VersionPrefix>1.0.1</VersionPrefix>
66
<Authors>Serilog Contributors</Authors>
7-
<TargetFrameworks>netstandard1.0</TargetFrameworks>
7+
<TargetFrameworks>net45;net46;netstandard1.0;netstandard2.0</TargetFrameworks>
88
<AssemblyName>Serilog.Sinks.Debug</AssemblyName>
99
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
1010
<SignAssembly>true</SignAssembly>
@@ -34,4 +34,16 @@
3434
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
3535
</ItemGroup>
3636

37+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
38+
<DefineConstants>$(DefineConstants);DEBUG_WRITE</DefineConstants>
39+
</PropertyGroup>
40+
41+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net46' ">
42+
<DefineConstants>$(DefineConstants);DEBUG_WRITE</DefineConstants>
43+
</PropertyGroup>
44+
45+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
46+
<DefineConstants>$(DefineConstants);DEBUG_WRITE</DefineConstants>
47+
</PropertyGroup>
48+
3749
</Project>

src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ public void Emit(LogEvent logEvent)
3434
using (var buffer = new StringWriter())
3535
{
3636
_formatter.Format(logEvent, buffer);
37-
System.Diagnostics.Debug.WriteLine(buffer.ToString());
37+
#if DEBUG_WRITE
38+
System.Diagnostics.Debug.Write(buffer.ToString());
39+
#else
40+
System.Diagnostics.Debug.WriteLine(buffer.ToString().Trim());
41+
#endif
3842
}
3943
}
4044
}

0 commit comments

Comments
 (0)