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` (dotnet#66862)

Related to dotnet#43605
  • Loading branch information
maxkoshevoi authored and radekdoulik committed Mar 30, 2022
1 parent 12a3b99 commit a186dbc
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 a186dbc

Please sign in to comment.