Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit 532dc6d

Browse files
author
Victor Hurdugaci
committed
Compile with debug symbol
1 parent 901c1ae commit 532dc6d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/Microsoft.Framework.Logging.Debug/DebugLogger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.Framework.Logging.Debug
99
/// <summary>
1010
/// A logger that writes messages in the debug output window only when a debugger is attached.
1111
/// </summary>
12-
public class DebugLogger : ILogger
12+
public partial class DebugLogger : ILogger
1313
{
1414
private readonly Func<string, LogLevel, bool> _filter;
1515
private readonly string _name;
@@ -83,7 +83,7 @@ public void Log(LogLevel logLevel, int eventId, object state, Exception exceptio
8383
}
8484

8585
message = $"{ logLevel }: {message}";
86-
System.Diagnostics.Debug.WriteLine(message, _name);
86+
DebugWriteLine(message, _name);
8787
}
8888
}
8989
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
// We need to define the DEBUG symbol because we want the logger
5+
// to work even when this package is compiled on release. Otherwise,
6+
// the call to Debug.WriteLine will not be in the release binary
7+
#define DEBUG
8+
9+
namespace Microsoft.Framework.Logging.Debug
10+
{
11+
public partial class DebugLogger
12+
{
13+
private void DebugWriteLine(string message, string name)
14+
{
15+
System.Diagnostics.Debug.WriteLine(message, name);
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)