Skip to content

Commit 570edbd

Browse files
authored
Merge pull request #2 from nblumhardt/dev
Define DEBUG so that Debug calls aren't compiled out
2 parents e6350a5 + 3cf8e51 commit 570edbd

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

src/Serilog.Sinks.Debug/DebugLoggerConfigurationExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static class ConsoleLoggerConfigurationExtensions
3838
/// <param name="levelSwitch">A switch allowing the pass-through minimum level
3939
/// to be changed at runtime.</param>
4040
/// <param name="outputTemplate">A message template describing the format used to write to the sink.
41-
/// the default is <code>"[{Timestamp:HH:mm:ss} {Level:u3}] {Message}{NewLine}{Exception}"</code>.</param>
41+
/// the default is <code>"[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"</code>.</param>
4242
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
4343
/// <returns>Configuration object allowing method chaining.</returns>
4444
public static LoggerConfiguration Debug(

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
<RootNamespace>Serilog</RootNamespace>
2525
</PropertyGroup>
2626

27+
<PropertyGroup>
28+
<!-- This is required so that calls to System.Diagnostics.Debug aren't compiled out of the release binary. -->
29+
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
30+
</PropertyGroup>
31+
2732
<ItemGroup>
2833
<PackageReference Include="Serilog" Version="2.5.0" />
2934
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Serilog.Sinks.Debug.Tests
2+
{
3+
public class DebugSinkTests
4+
{
5+
// To do, need some tests here...
6+
}
7+
}

test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@
2828
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
2929
</ItemGroup>
3030

31+
<PropertyGroup>
32+
<!-- This is required so that calls to System.Diagnostics.Debug aren't compiled out of the release binary. -->
33+
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
34+
</PropertyGroup>
35+
3136
</Project>

0 commit comments

Comments
 (0)