Skip to content

Commit 61e35c1

Browse files
committed
Feat: CodeOfChaos.Extensions.MicrosoftLogging
1 parent 9ae3c86 commit 61e35c1

File tree

10 files changed

+156
-84
lines changed

10 files changed

+156
-84
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
- name: Run tests - Extensions.EntityFrameworkCore
3838
run: dotnet run -c Release --no-restore --no-build
3939
working-directory: "tests/Tests.CodeOfChaos.Extensions.EntityFrameworkCore"
40+
- name: Run tests - Extensions.MicrosoftLogging
41+
run: dotnet run -c Release --no-restore --no-build
42+
working-directory: "tests/Tests.CodeOfChaos.Extensions.MicrosoftLogging"
4043
- name: Run tests - Extensions.Serilog
4144
run: dotnet run -c Release --no-restore --no-build
4245
working-directory: "tests/Tests.CodeOfChaos.Extensions.Serilog"
@@ -54,6 +57,7 @@ jobs:
5457
dotnet nuget push src/CodeOfChaos.Extensions/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
5558
dotnet nuget push src/CodeOfChaos.Extensions.AspNetCore/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
5659
dotnet nuget push src/CodeOfChaos.Extensions.EntityFrameworkCore/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
60+
dotnet nuget push src/CodeOfChaos.Extensions.MicrosoftLogging/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
5761
dotnet nuget push src/CodeOfChaos.Extensions.Serilog/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
5862
dotnet nuget push src/CodeOfChaos.Extensions.Analyzers/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
5963
dotnet nuget push src/CodeOfChaos.Extensions.DependencyInjection/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate

CodeOfChaos.Extensions.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeOfChaos.Extensions.Depe
4242
EndProject
4343
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.CodeOfChaos.Extensions.Analyzers", "tests\Tests.CodeOfChaos.Extensions.Analyzers\Tests.CodeOfChaos.Extensions.Analyzers.csproj", "{E1F41678-9171-42C9-8877-F326D878AE05}"
4444
EndProject
45+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeOfChaos.Extensions.MicrosoftLogging", "src\CodeOfChaos.Extensions.MicrosoftLogging\CodeOfChaos.Extensions.MicrosoftLogging.csproj", "{76717F23-6ED9-4C3B-81AD-89C79B7D36BE}"
46+
EndProject
4547
Global
4648
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4749
Debug|Any CPU = Debug|Any CPU
@@ -112,6 +114,10 @@ Global
112114
{E1F41678-9171-42C9-8877-F326D878AE05}.Debug|Any CPU.Build.0 = Debug|Any CPU
113115
{E1F41678-9171-42C9-8877-F326D878AE05}.Release|Any CPU.ActiveCfg = Release|Any CPU
114116
{E1F41678-9171-42C9-8877-F326D878AE05}.Release|Any CPU.Build.0 = Release|Any CPU
117+
{76717F23-6ED9-4C3B-81AD-89C79B7D36BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
118+
{76717F23-6ED9-4C3B-81AD-89C79B7D36BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
119+
{76717F23-6ED9-4C3B-81AD-89C79B7D36BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
120+
{76717F23-6ED9-4C3B-81AD-89C79B7D36BE}.Release|Any CPU.Build.0 = Release|Any CPU
115121
EndGlobalSection
116122
GlobalSection(NestedProjects) = preSolution
117123
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
@@ -131,5 +137,6 @@ Global
131137
{9B1053FC-89D7-412D-AA24-618EFC97FDA4} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}
132138
{9FC9F294-BDB7-4479-B002-F0409E050A1E} = {9F807E1D-D361-4CAB-8FD2-39B8A4F7AFFF}
133139
{E1F41678-9171-42C9-8877-F326D878AE05} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
140+
{76717F23-6ED9-4C3B-81AD-89C79B7D36BE} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}
134141
EndGlobalSection
135142
EndGlobal

examples/AterraEngine.DependencyInjection.Generators.Sample/AterraEngine.DependencyInjection.Generators.Sample.csproj

Lines changed: 0 additions & 22 deletions
This file was deleted.

examples/AterraEngine.DependencyInjection.Generators.Sample/Example.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/AterraEngine.DependencyInjection.Generators.Sample/ExampleFactory.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/AterraEngine.DependencyInjection.Generators.Sample/ExamplePooled.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/AterraEngine.DependencyInjection.Generators.Sample/MultipleExample.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
8+
<!-- Main package name -->
9+
<PackageId>CodeOfChaos.Extensions.MicrosoftLogging</PackageId>
10+
<Version>0.36.4</Version>
11+
<Authors>Anna Sas</Authors>
12+
<Description>A simple extension library for Microsoft's logging</Description>
13+
<PackageProjectUrl>https://github.com/code-of-chaos/cs-code_of_chaos-extensions</PackageProjectUrl>
14+
<PackageTags>extensions linq EntityFrameworkCore</PackageTags>
15+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
16+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
17+
<IncludeSymbols>true</IncludeSymbols>
18+
<DebugType>embedded</DebugType>
19+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
20+
<PackageReadmeFile>README.md</PackageReadmeFile>
21+
<PackageIcon>icon.png</PackageIcon>
22+
</PropertyGroup>
23+
24+
<ItemGroup>
25+
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
26+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.2" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<None Include="..\..\LICENSE" Pack="true" PackagePath="" Visible="false" />
31+
<None Include="README.md" Pack="true" PackagePath="" />
32+
<None Include="../../assets/icon.png" Pack="true" PackagePath="" Visible="false" />
33+
</ItemGroup>
34+
35+
</Project>
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// ---------------------------------------------------------------------------------------------------------------------
2+
// Imports
3+
// ---------------------------------------------------------------------------------------------------------------------
4+
using JetBrains.Annotations;
5+
6+
// ReSharper disable once CheckNamespace
7+
namespace Microsoft.Extensions.Logging;
8+
9+
// ---------------------------------------------------------------------------------------------------------------------
10+
// Code
11+
// ---------------------------------------------------------------------------------------------------------------------
12+
public static class LoggerExtensions {
13+
14+
[StringFormatMethod("message")]
15+
public static void Debug(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
16+
=> logger.LogDebug(eventId, exception, message, args);
17+
18+
[StringFormatMethod("message")]
19+
public static void Debug(this ILogger logger, EventId eventId, string? message, params object?[] args)
20+
=> logger.LogDebug(eventId, message, args);
21+
22+
[StringFormatMethod("message")]
23+
public static void Debug(this ILogger logger, Exception? exception, string? message, params object?[] args)
24+
=> logger.LogDebug(exception, message, args);
25+
26+
[StringFormatMethod("message")]
27+
public static void Debug(this ILogger logger, string? message, params object?[] args)
28+
=> logger.LogDebug(message, args);
29+
30+
[StringFormatMethod("message")]
31+
public static void Trace(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
32+
=> logger.LogTrace(eventId, exception, message, args);
33+
34+
[StringFormatMethod("message")]
35+
public static void Trace(this ILogger logger, EventId eventId, string? message, params object?[] args)
36+
=> logger.LogTrace(eventId, message, args);
37+
38+
[StringFormatMethod("message")]
39+
public static void Trace(this ILogger logger, Exception? exception, string? message, params object?[] args)
40+
=> logger.LogTrace(exception, message, args);
41+
42+
[StringFormatMethod("message")]
43+
public static void Trace(this ILogger logger, string? message, params object?[] args)
44+
=> logger.LogTrace(message, args);
45+
46+
[StringFormatMethod("message")]
47+
public static void Information(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
48+
=> logger.LogInformation(eventId, exception, message, args);
49+
50+
[StringFormatMethod("message")]
51+
public static void Information(this ILogger logger, EventId eventId, string? message, params object?[] args)
52+
=> logger.LogInformation(eventId, message, args);
53+
54+
[StringFormatMethod("message")]
55+
public static void Information(this ILogger logger, Exception? exception, string? message, params object?[] args)
56+
=> logger.LogInformation(exception, message, args);
57+
58+
[StringFormatMethod("message")]
59+
public static void Information(this ILogger logger, string? message, params object?[] args)
60+
=> logger.LogInformation(message, args);
61+
62+
[StringFormatMethod("message")]
63+
public static void Warning(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
64+
=> logger.LogWarning(eventId, exception, message, args);
65+
66+
[StringFormatMethod("message")]
67+
public static void Warning(this ILogger logger, EventId eventId, string? message, params object?[] args)
68+
=> logger.LogWarning(eventId, message, args);
69+
70+
[StringFormatMethod("message")]
71+
public static void Warning(this ILogger logger, Exception? exception, string? message, params object?[] args)
72+
=> logger.LogWarning(exception, message, args);
73+
74+
[StringFormatMethod("message")]
75+
public static void Warning(this ILogger logger, string? message, params object?[] args)
76+
=> logger.LogWarning(message, args);
77+
78+
[StringFormatMethod("message")]
79+
public static void Error(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
80+
=> logger.LogError(eventId, exception, message, args);
81+
82+
[StringFormatMethod("message")]
83+
public static void Error(this ILogger logger, EventId eventId, string? message, params object?[] args)
84+
=> logger.LogError(eventId, message, args);
85+
86+
[StringFormatMethod("message")]
87+
public static void Error(this ILogger logger, Exception? exception, string? message, params object?[] args)
88+
=> logger.LogError(exception, message, args);
89+
90+
[StringFormatMethod("message")]
91+
public static void Error(this ILogger logger, string? message, params object?[] args)
92+
=> logger.LogError(message, args);
93+
94+
[StringFormatMethod("message")]
95+
public static void Critical(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
96+
=> logger.LogCritical(eventId, exception, message, args);
97+
98+
[StringFormatMethod("message")]
99+
public static void Critical(this ILogger logger, EventId eventId, string? message, params object?[] args)
100+
=> logger.LogCritical(eventId, message, args);
101+
102+
[StringFormatMethod("message")]
103+
public static void Critical(this ILogger logger, Exception? exception, string? message, params object?[] args)
104+
=> logger.LogCritical(exception, message, args);
105+
106+
[StringFormatMethod("message")]
107+
public static void Critical(this ILogger logger, string? message, params object?[] args)
108+
=> logger.LogCritical(message, args);
109+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# CodeOfChaos.Extensions.MicrosoftLogging

0 commit comments

Comments
 (0)