Skip to content

Commit 000e1a8

Browse files
authored
[Group 4] Enable nullable annotations for Microsoft.Extensions.Logging.Debug (#66862)
Related to #43605
1 parent 55e012e commit 000e1a8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/libraries/Microsoft.Extensions.Logging.Debug/ref/Microsoft.Extensions.Logging.Debug.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
4+
<Nullable>enable</Nullable>
45
</PropertyGroup>
56

67
<ItemGroup>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public DebugLogger(string name)
2323
}
2424

2525
/// <inheritdoc />
26-
public IDisposable BeginScope<TState>(TState state)
26+
public IDisposable BeginScope<TState>(TState state) where TState : notnull
2727
{
2828
return NullScope.Instance;
2929
}
@@ -37,7 +37,7 @@ public bool IsEnabled(LogLevel logLevel)
3737
}
3838

3939
/// <inheritdoc />
40-
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
40+
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
4141
{
4242
if (!IsEnabled(logLevel))
4343
{

src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
5+
<Nullable>enable</Nullable>
56
<EnableDefaultItems>true</EnableDefaultItems>
67
<!-- Use targeting pack references instead of granular ones in the project file. -->
78
<DisableImplicitAssemblyReferences>false</DisableImplicitAssemblyReferences>

0 commit comments

Comments
 (0)