Skip to content

Commit

Permalink
chore: Extended implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
samtrion committed May 19, 2024
1 parent 9cc5adf commit 77e3c5a
Show file tree
Hide file tree
Showing 20 changed files with 498 additions and 117 deletions.
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@
<Import Project="$(DirEngineeringSettings)src.build.props" Condition=" '$(IsTestableProject)' != 'true' " />
<Import Project="$(DirEngineeringSettings)tests.build.props" Condition=" '$(IsTestableProject)' == 'true' " />

<PropertyGroup>
<ProjectTargetFrameworks>net6.0;net7.0;net8.0</ProjectTargetFrameworks>
<TestTargetFrameworks>net6.0;net7.0;net8.0</TestTargetFrameworks>

<DisableBannedApiForUTC>true</DisableBannedApiForUTC>
</PropertyGroup>

</Project>
3 changes: 3 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="NetEvolve.Arguments" Version="1.2.0" />
<PackageVersion Include="xunit" Version="2.8.0" />
<PackageVersion Include="xunit.extensibility.core" Version="2.8.0" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>
</Project>
9 changes: 4 additions & 5 deletions Extensions.Logging.XUnit.sln → Logging.XUnit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EFE8181B-6FA
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{BD750CCE-0318-424D-89B4-9C66EF329E96}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.Logging.XUnit", "src\NetEvolve.Extensions.Logging.XUnit\NetEvolve.Extensions.Logging.XUnit.csproj", "{3F3CD6EC-4636-4B58-8400-09AC2B9BAFDF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Logging.XUnit", "src\NetEvolve.Logging.XUnit\NetEvolve.Logging.XUnit.csproj", "{3F3CD6EC-4636-4B58-8400-09AC2B9BAFDF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.Logging.XUnit.Tests.Unit", "tests\NetEvolve.Extensions.Logging.XUnit.Tests.Unit\NetEvolve.Extensions.Logging.XUnit.Tests.Unit.csproj", "{EAAD2C22-48F4-4E37-9A46-0350C6B84388}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Logging.XUnit.Tests.Unit", "tests\NetEvolve.Logging.XUnit.Tests.Unit\NetEvolve.Logging.XUnit.Tests.Unit.csproj", "{EAAD2C22-48F4-4E37-9A46-0350C6B84388}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.Logging.XUnit.Tests.Integration", "tests\NetEvolve.Extensions.Logging.XUnit.Tests.Integration\NetEvolve.Extensions.Logging.XUnit.Tests.Integration.csproj", "{F2B38EDD-63F9-4027-9EA6-D1E0C6387C12}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Logging.XUnit.Tests.Integration", "tests\NetEvolve.Logging.XUnit.Tests.Integration\NetEvolve.Logging.XUnit.Tests.Integration.csproj", "{F2B38EDD-63F9-4027-9EA6-D1E0C6387C12}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -59,8 +59,7 @@ Global
{F2B38EDD-63F9-4027-9EA6-D1E0C6387C12} = {BD750CCE-0318-424D-89B4-9C66EF329E96}
EndGlobalSection
EndGlobal
Any CPU
{6211ACA9-9A91-4218-8B4B-E94F91796B58}.Release|Any CPU.Build.0 = Release|Any CPU
CPU.Build.0 = Release|Any CPU
{FFF70EC4-D0FD-4D73-8599-7FF442133436}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFF70EC4-D0FD-4D73-8599-7FF442133436}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFF70EC4-D0FD-4D73-8599-7FF442133436}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
89 changes: 0 additions & 89 deletions src/NetEvolve.Extensions.Logging.XUnit/XUnitLogger.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/NetEvolve.Extensions.Logging.XUnit/XUnitLoggerOfT.cs

This file was deleted.

3 changes: 0 additions & 3 deletions src/NetEvolve.Extensions.Logging.XUnit/XUnitLoggerOptions.cs

This file was deleted.

22 changes: 22 additions & 0 deletions src/NetEvolve.Logging.XUnit/LoggedMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace NetEvolve.Logging.XUnit;

using System;
using Microsoft.Extensions.Logging;

/// <summary>
/// Represents a logged message, including the timestamp, log level, event ID, message, exception, and scopes.
/// </summary>
/// <param name="Timestamp">Timestamp of the logged message.</param>
/// <param name="LogLevel">LogLevel of the logged message.</param>
/// <param name="EventId">EventId of the logged message.</param>
/// <param name="Message">Logged message.</param>
/// <param name="Exception">Logged exception. (optional)</param>
/// <param name="Scopes">Logged scopes.</param>
public record struct LoggedMessage(
DateTimeOffset Timestamp,
LogLevel LogLevel,
EventId EventId,
string Message,
Exception? Exception,
IReadOnlyCollection<object?> Scopes
);
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>$(ProjectTargetFrameworks)</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" />
<PackageReference Include="NetEvolve.Arguments" />
<PackageReference Include="xunit.extensibility.core" />
<PackageReference Include="xunit.extensibility.execution" />
</ItemGroup>

</Project>
File renamed without changes.
Loading

0 comments on commit 77e3c5a

Please sign in to comment.