Skip to content

Commit

Permalink
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Loggi…
Browse files Browse the repository at this point in the history
…ng.Debug` (#66862)

Related to #43605
  • Loading branch information
maxkoshevoi committed Mar 25, 2022
1 parent 55e012e commit 000e1a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public DebugLogger(string name)
}

/// <inheritdoc />
public IDisposable BeginScope<TState>(TState state)
public IDisposable BeginScope<TState>(TState state) where TState : notnull
{
return NullScope.Instance;
}
Expand All @@ -37,7 +37,7 @@ public bool IsEnabled(LogLevel logLevel)
}

/// <inheritdoc />
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
if (!IsEnabled(logLevel))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>enable</Nullable>
<EnableDefaultItems>true</EnableDefaultItems>
<!-- Use targeting pack references instead of granular ones in the project file. -->
<DisableImplicitAssemblyReferences>false</DisableImplicitAssemblyReferences>
Expand Down

0 comments on commit 000e1a8

Please sign in to comment.