Skip to content

Commit

Permalink
cleaning up XunitLogger instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Jul 17, 2024
1 parent ddd5c1f commit f009298
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 131 deletions.
5 changes: 3 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [1.5.25] / 17 June 2024
## [1.5.26] / 17 July 2024

* [Update Akka.NET to 1.5.25](https://github.com/akkadotnet/akka.net/releases/tag/1.5.25), which resolves a critical bug: [Akka.Logging: v1.5.21 appears to have truncated log source, timestamps, etc from all log messages ](https://github.com/akkadotnet/akka.net/issues/7255)
* [Update Akka.NET to 1.5.26](https://github.com/akkadotnet/akka.net/releases/tag/1.5.26)
* Added scopes to all Microsoft.Extensions.Logging output, for better semantic logging support.

## [1.5.24] / 10 June 2024

Expand Down
17 changes: 16 additions & 1 deletion src/Akka.Hosting.TestKit/Internals/XUnitLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ namespace Akka.Hosting.TestKit.Internals
public class XUnitLogger: ILogger
{
private const string NullFormatted = "[null]";

internal sealed class NullScope : IDisposable
{
public static NullScope Instance { get; } = new NullScope();

private NullScope()
{
}

/// <inheritdoc />
public void Dispose()
{
}
}


private readonly string _category;
private readonly ITestOutputHelper _helper;
Expand Down Expand Up @@ -60,7 +75,7 @@ public bool IsEnabled(LogLevel logLevel)

public IDisposable BeginScope<TState>(TState state) where TState : notnull
{
throw new NotImplementedException();
return NullScope.Instance;
}

private static bool TryFormatMessage<TState>(
Expand Down
6 changes: 6 additions & 0 deletions src/Akka.Hosting.Tests/Akka.Hosting.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<Reference Include="Akka.Hosting.TestKit">
<HintPath>bin\Debug\net6.0\Akka.Hosting.TestKit.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions src/Akka.Hosting.Tests/ExtensionsSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Configuration;
using Akka.Event;
using Akka.TestKit.Xunit2.Internals;
using Akka.Hosting.TestKit.Internals;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down
1 change: 1 addition & 0 deletions src/Akka.Hosting.Tests/Logging/LogMessageFormatterSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Akka.Actor;
using Akka.Configuration;
using Akka.Event;
using Akka.Hosting.TestKit.Internals;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down
98 changes: 0 additions & 98 deletions src/Akka.Hosting.Tests/XUnitLogger.cs

This file was deleted.

26 changes: 0 additions & 26 deletions src/Akka.Hosting.Tests/XUnitLoggerProvider.cs

This file was deleted.

5 changes: 3 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<PropertyGroup>
<Copyright>Copyright © 2013-2023 Akka.NET Team</Copyright>
<Authors>Akka.NET Team</Authors>
<VersionPrefix>1.5.19</VersionPrefix>
<PackageReleaseNotes>• [Update Akka.NET to 1.5.19](https://github.com/akkadotnet/akka.net/releases/tag/1.5.19)</PackageReleaseNotes>
<VersionPrefix>1.5.26</VersionPrefix>
<PackageReleaseNotes>• [Update Akka.NET to 1.5.26](https://github.com/akkadotnet/akka.net/releases/tag/1.5.26)
• Added scopes to all Microsoft.Extensions.Logging output%2C for better semantic logging support.</PackageReleaseNotes>
<PackageIcon>akkalogo.png</PackageIcon>
<PackageProjectUrl>
https://github.com/akkadotnet/Akka.Hosting
Expand Down

0 comments on commit f009298

Please sign in to comment.