Skip to content

Commit 2bf54d9

Browse files
committed
Migrating local changes
1 parent e47d2fb commit 2bf54d9

27 files changed

+428
-163
lines changed

.github/workflows/dotnet.yml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,56 +12,56 @@ jobs:
1212
name: Build and analyze
1313
runs-on: windows-latest
1414
steps:
15-
- name: Set up JDK
16-
uses: actions/[email protected]
17-
with:
18-
java-version: 17
19-
distribution: 'zulu'
20-
21-
- name: Checkout
22-
uses: actions/[email protected]
23-
with:
24-
fetch-depth: 0
15+
- name: Set up JDK
16+
uses: actions/[email protected]
17+
with:
18+
java-version: 17
19+
distribution: 'zulu'
2520

26-
- name: Cache SonarCloud packages
27-
uses: actions/[email protected]
28-
with:
29-
path: ~\sonar\cache
30-
key: ${{ runner.os }}-sonar
31-
restore-keys: ${{ runner.os }}-sonar
21+
- name: Checkout
22+
uses: actions/[email protected]
23+
with:
24+
fetch-depth: 0
3225

33-
- name: Cache SonarCloud scanner
34-
id: cache-sonar-scanner
35-
uses: actions/[email protected]
36-
with:
37-
path: .\.sonar\scanner
38-
key: ${{ runner.os }}-sonar-scanner
39-
restore-keys: ${{ runner.os }}-sonar-scanner
40-
41-
- name: Install SonarCloud scanner
42-
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
43-
shell: powershell
44-
run: |
45-
New-Item -Path .\.sonar\scanner -ItemType Directory
46-
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
47-
48-
- name: Build and analyze
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52-
shell: powershell
53-
run: |
54-
dotnet tool install --global dotnet-coverage
55-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_astar-dev-logging-extensions" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
56-
dotnet build --configuration Release
57-
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Acceptance.Tests"' -f xml -o 'coverage.xml'
58-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
26+
- name: Cache SonarCloud packages
27+
uses: actions/[email protected]
28+
with:
29+
path: ~\sonar\cache
30+
key: ${{ runner.os }}-sonar
31+
restore-keys: ${{ runner.os }}-sonar
5932

60-
- name: Pack NuGet package
61-
if: github.ref == 'refs/heads/main'
62-
run: dotnet pack .\src\AStar.Dev.Logging.Extensions\AStar.Dev.Logging.Extensions.csproj
33+
- name: Cache SonarCloud scanner
34+
id: cache-sonar-scanner
35+
uses: actions/[email protected]
36+
with:
37+
path: .\.sonar\scanner
38+
key: ${{ runner.os }}-sonar-scanner
39+
restore-keys: ${{ runner.os }}-sonar-scanner
40+
41+
- name: Install SonarCloud scanner
42+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
43+
shell: powershell
44+
run: |
45+
New-Item -Path .\.sonar\scanner -ItemType Directory
46+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
47+
48+
- name: Build and analyze
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52+
shell: powershell
53+
run: |
54+
dotnet tool install --global dotnet-coverage
55+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_astar-dev-utilities" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
56+
dotnet build --configuration Release
57+
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Acceptance.Tests"' -f xml -o 'coverage.xml'
58+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
59+
60+
- name: Pack NuGet package
61+
if: github.ref == 'refs/heads/main'
62+
run: dotnet pack .\src\AStar.Dev.Utilities\AStar.Dev.Utilities.csproj
63+
64+
- name: Push to NuGet
65+
if: github.ref == 'refs/heads/main'
66+
run: dotnet nuget push "**\AStar.Dev.Utilities.*.nupkg" --api-key ${{secrets.nuget_api_key}} --skip-duplicate --source https://api.nuget.org/v3/index.json
6367

64-
- name: Push to NuGet
65-
if: github.ref == 'refs/heads/main'
66-
run: dotnet nuget push "**\AStar.Dev.Logging.Extensions.*.nupkg" --api-key ${{secrets.nuget_api_key}} --skip-duplicate --source https://api.nuget.org/v3/index.json
67-

.idea/.idea.AStar.Dev.Logging.Extensions/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.AStar.Dev.Logging.Extensions/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.AStar.Dev.Logging.Extensions/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.AStar.Dev.Logging.Extensions/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AStar.Dev.Logging.Extensions.sln

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{2148A5BF-30D5-460A-BE18-C19426C87428}"
77
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{5956040C-7B01-422A-BA94-58CB8F1951C6}"
9-
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Logging.Extensions.Unit.Tests", "tests\unit\AStar.Dev.Logging.Extensions.Unit.Tests\AStar.Dev.Logging.Extensions.Unit.Tests.csproj", "{61823C1A-5AA5-4C23-944A-F1029941086C}"
11-
EndProject
128
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BB29ADA9-37FE-434B-BF05-2E195E7C83A2}"
139
EndProject
1410
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Logging.Extensions", "src\AStar.Dev.Logging.Extensions\AStar.Dev.Logging.Extensions.csproj", "{9F2D808F-D24F-4031-9C2D-7744B32E15FC}"
1511
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AStar.Dev.Logging.Extensions.Tests.Unit", "tests\AStar.Dev.Logging.Extensions.Tests.Unit\AStar.Dev.Logging.Extensions.Tests.Unit.csproj", "{B6EE17A9-0491-466B-8240-A304617A9DB3}"
13+
EndProject
1614
Global
1715
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1816
Debug|Any CPU = Debug|Any CPU
@@ -22,18 +20,17 @@ Global
2220
HideSolutionNode = FALSE
2321
EndGlobalSection
2422
GlobalSection(ProjectConfigurationPlatforms) = postSolution
25-
{61823C1A-5AA5-4C23-944A-F1029941086C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26-
{61823C1A-5AA5-4C23-944A-F1029941086C}.Debug|Any CPU.Build.0 = Debug|Any CPU
27-
{61823C1A-5AA5-4C23-944A-F1029941086C}.Release|Any CPU.ActiveCfg = Release|Any CPU
28-
{61823C1A-5AA5-4C23-944A-F1029941086C}.Release|Any CPU.Build.0 = Release|Any CPU
2923
{9F2D808F-D24F-4031-9C2D-7744B32E15FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3024
{9F2D808F-D24F-4031-9C2D-7744B32E15FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
3125
{9F2D808F-D24F-4031-9C2D-7744B32E15FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
3226
{9F2D808F-D24F-4031-9C2D-7744B32E15FC}.Release|Any CPU.Build.0 = Release|Any CPU
27+
{B6EE17A9-0491-466B-8240-A304617A9DB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28+
{B6EE17A9-0491-466B-8240-A304617A9DB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
29+
{B6EE17A9-0491-466B-8240-A304617A9DB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{B6EE17A9-0491-466B-8240-A304617A9DB3}.Release|Any CPU.Build.0 = Release|Any CPU
3331
EndGlobalSection
3432
GlobalSection(NestedProjects) = preSolution
35-
{5956040C-7B01-422A-BA94-58CB8F1951C6} = {2148A5BF-30D5-460A-BE18-C19426C87428}
36-
{61823C1A-5AA5-4C23-944A-F1029941086C} = {5956040C-7B01-422A-BA94-58CB8F1951C6}
3733
{9F2D808F-D24F-4031-9C2D-7744B32E15FC} = {BB29ADA9-37FE-434B-BF05-2E195E7C83A2}
34+
{B6EE17A9-0491-466B-8240-A304617A9DB3} = {2148A5BF-30D5-460A-BE18-C19426C87428}
3835
EndGlobalSection
3936
EndGlobal

src/AStar.Dev.Logging.Extensions/AStar.Dev.Logging.Extensions.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8-
</PropertyGroup>
8+
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
9+
<AnalysisLevel>latest-recommended</AnalysisLevel>
10+
</PropertyGroup>
911

1012

1113
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -41,7 +43,7 @@
4143

4244
<ItemGroup>
4345
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
44-
<PackageReference Include="AStar.Dev.Utilities" Version="1.5.1" />
46+
<PackageReference Include="AStar.Dev.Utilities" Version="1.6.0" />
4547
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
4648
<PackageReference Include="Serilog.Enrichers.Span" Version="3.1.0" />
4749
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
11.3 KB
Binary file not shown.
12.2 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Microsoft.Extensions.Logging;
2+
3+
namespace AStar.Dev.Logging.Extensions;
4+
5+
/// <summary>
6+
/// The <see cref="AStarEventIds" /> class contains the defined <see cref="Microsoft.Extensions.Logging.EventId" /> events available for logging
7+
/// Stand-alone <see cref="Microsoft.Extensions.Logging.EventId" /> events can be defined but care should be taken to avoid reusing the values used here
8+
/// </summary>
9+
public static class AStarEventIds
10+
{
11+
/// <summary>
12+
/// Gets the <see cref="EventId" /> preconfigured for logging a page view
13+
/// </summary>
14+
public static EventId PageView => new(1_000, "Page view");
15+
}

0 commit comments

Comments
 (0)