File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
<PropertyGroup >
4
4
<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 >
6
6
<Authors >Serilog Contributors</Authors >
7
- <TargetFrameworks >netstandard1.0</TargetFrameworks >
7
+ <TargetFrameworks >net45;net46; netstandard1.0;netstandard2 .0</TargetFrameworks >
8
8
<AssemblyName >Serilog.Sinks.Debug</AssemblyName >
9
9
<AssemblyOriginatorKeyFile >../../assets/Serilog.snk</AssemblyOriginatorKeyFile >
10
10
<SignAssembly >true</SignAssembly >
34
34
<PackageReference Include =" System.Diagnostics.Debug" Version =" 4.3.0" />
35
35
</ItemGroup >
36
36
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
+
37
49
</Project >
Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ public void Emit(LogEvent logEvent)
34
34
using ( var buffer = new StringWriter ( ) )
35
35
{
36
36
_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
38
42
}
39
43
}
40
44
}
You can’t perform that action at this time.
0 commit comments