File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments