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

Commit ad487c7

Browse files
committed
Fix overload of Debug.WriteLine we are using
1 parent 1f2c413 commit ad487c7

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

src/Microsoft.Extensions.Logging.Console/ConsoleLogger.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using System.Collections;
6-
using System.Collections.Generic;
75
using System.Text;
86
using Microsoft.Extensions.Logging.Console.Internal;
97
using Microsoft.Extensions.PlatformAbstractions;

src/Microsoft.Extensions.Logging.Debug/DebugLogger.debug.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public partial class DebugLogger
1212
{
1313
private void DebugWriteLine(string message, string name)
1414
{
15-
System.Diagnostics.Debug.WriteLine(message, name);
15+
System.Diagnostics.Debug.WriteLine(message, category: name);
1616
}
1717
}
1818
}

src/Microsoft.Extensions.Logging.Debug/project.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@
2020
"Microsoft.Extensions.Logging.Abstractions": "1.0.0-*"
2121
},
2222
"frameworks": {
23-
"netstandard1.1": {
23+
"net451": {
24+
"frameworkAssemblies": {
25+
"System.Runtime": { "type": "build" }
26+
}
27+
},
28+
"netstandard1.3": {
2429
"dependencies": {
2530
"System.Diagnostics.Debug": "4.0.11-*"
2631
},
2732
"imports": [
28-
"dotnet5.2"
33+
"dotnet5.4"
2934
]
3035
}
3136
}

test/Microsoft.Extensions.Logging.Test/DebugLoggerTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using System;
45
using Microsoft.Extensions.Logging.Debug;
56
using Xunit;
67

@@ -36,5 +37,16 @@ public void CallingBeginScopeOnLogger_ReturnsNonNullableInstance()
3637
// Assert
3738
Assert.NotNull(disposable);
3839
}
40+
41+
[Fact]
42+
public void CallingLogWithCurlyBracesAfterFormatter_DoesNotThrow()
43+
{
44+
// Arrange
45+
var logger = new DebugLogger("Test");
46+
var message = "{test string}";
47+
48+
// Act
49+
logger.Log(LogLevel.Debug, 0, message, null, (s, e) => s);
50+
}
3951
}
4052
}

0 commit comments

Comments
 (0)