Skip to content

Commit

Permalink
chore: Update logging to .net 7 (to get latest nullable annotations)
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Oct 30, 2023
1 parent 081e62a commit 8fd173e
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PackageReference Include="Uno.UI" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.UI.DevServer" Version="5.0.0-dev.3552" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />

<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<UpToDateCheckInput Include="..\..\shared\**\*.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.UI.Skia.Gtk" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.UI.DevServer" Version="5.0.0-dev.3552" /><!--Note: Keep the DevServer package also in release for hot reload tests (cf. HotReloadHelper).-->
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<UpToDateCheckInput Include="..\..\shared\**\*.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.UI.Skia.Linux.FrameBuffer" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.UI.DevServer" Version="5.0.0-dev.3552" /><!--Note: Keep the DevServer package also in release for hot reload tests (cf. HotReloadHelper).-->
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.UI.Skia.Wpf" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.UI.DevServer" Version="5.0.0-dev.3552"/><!--Note: Keep the DevServer package also in release for hot reload tests (cf. HotReloadHelper).-->
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
-->
<Version>6.2.11</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.UI.Xaml" Version="2.6.2" />
<PackageReference Include="Uno.UI" Version="4.6.19" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />
</ItemGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<None Include="wwwroot\web.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.4.0" />
<PackageReference Include="Uno.UI.WebAssembly" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.UI.DevServer" Version="5.0.0-dev.3552" Condition="'$(Configuration)'=='Debug'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Uno.WinUI" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.WinUI.DevServer" Version="5.0.0-dev.3552" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />

<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<UpToDateCheckInput Include="..\..\shared\**\*.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.WinUI.Skia.Gtk" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.WinUI.DevServer" Version="5.0.0-dev.3552" /><!--Note: Keep the DevServer package also in release for hot reload tests (cf. HotReloadHelper).-->
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<UpToDateCheckInput Include="..\..\shared\**\*.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.WinUI.Skia.Linux.FrameBuffer" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.WinUI.DevServer" Version="5.0.0-dev.3552" /><!--Note: Keep the DevServer package also in release for hot reload tests (cf. HotReloadHelper).-->
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.WinUI.Skia.Wpf" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.WinUI.DevServer" Version="5.0.0-dev.3552" /><!--Note: Keep the DevServer package also in release for hot reload tests (cf. HotReloadHelper).-->
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3552" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<None Include="wwwroot\web.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.4.0" />
<PackageReference Include="Uno.WinUI.WebAssembly" Version="5.0.0-dev.3552" />
<PackageReference Include="Uno.WinUI.DevServer" Version="5.0.0-dev.3552" Condition="'$(Configuration)'=='Debug'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.3" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.196" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />

<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ internal sealed partial class DevServer : IAsyncDisposable
public static async Task<DevServer> Start(CancellationToken ct)
{
#if !HAS_UNO_DEVSERVER
throw new NotSupportedException("Dev server is not supported on this platform.");
throw new NotSupportedException("Dev server has not been referenced.");
#else
var path = await GetDevServer(ct);
var port = GetTcpPort();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#if !UNO_RUNTIMETESTS_DISABLE_UI

#if !IS_UNO_RUNTIMETEST_PROJECT
#pragma warning disable
#endif

using System;
using System.Linq;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -42,7 +47,8 @@ public bool IsEnabled(LogLevel logLevel)
=> _logger.IsEnabled(logLevel);

/// <inheritdoc />
public IDisposable BeginScope<TState>(TState state)
public IDisposable? BeginScope<TState>(TState state)
where TState : notnull
=> _logger.BeginScope(state);

/// <inheritdoc />
Expand Down

0 comments on commit 8fd173e

Please sign in to comment.