Skip to content

Commit 66d5890

Browse files
authored
Merge pull request #71 from datalust/dev
9.0.0 Release
2 parents 1dad962 + 7f3ad97 commit 66d5890

File tree

69 files changed

+683
-644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+683
-644
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# If this file is renamed, the incrementing run attempt number will be reset.
2+
3+
name: CI
4+
5+
on:
6+
push:
7+
branches: [ "dev", "main" ]
8+
pull_request:
9+
branches: [ "dev", "main" ]
10+
11+
env:
12+
CI_BUILD_NUMBER_BASE: ${{ github.run_number }}
13+
CI_TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
14+
15+
jobs:
16+
build:
17+
18+
runs-on: windows-latest
19+
20+
permissions:
21+
contents: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Setup
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: 9.0.x
29+
- name: Compute build number
30+
shell: bash
31+
run: |
32+
echo "CI_BUILD_NUMBER=$(($CI_BUILD_NUMBER_BASE+130))" >> $GITHUB_ENV
33+
- name: Build and Publish
34+
env:
35+
DOTNET_CLI_TELEMETRY_OPTOUT: true
36+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
shell: pwsh
39+
run: |
40+
./Build.ps1
41+

Build.ps1

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,79 @@
1-
echo "build: Build started"
1+
Write-Output "build: Build started"
22

33
Push-Location $PSScriptRoot
44

5+
Write-Output "build: Tool versions follow"
6+
7+
dotnet --version
8+
dotnet --list-sdks
9+
510
if(Test-Path .\artifacts) {
6-
echo "build: Cleaning .\artifacts"
7-
Remove-Item .\artifacts -Force -Recurse
11+
Write-Output "build: Cleaning ./artifacts"
12+
Remove-Item ./artifacts -Force -Recurse
813
}
914

1015
& dotnet restore --no-cache
1116

12-
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
13-
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
14-
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "main" -and $revision -ne "local"]
17+
$dbp = [Xml] (Get-Content .\Directory.Build.props)
18+
$versionPrefix = $dbp.Project.PropertyGroup.VersionPrefix
1519

16-
echo "build: Version suffix is $suffix"
20+
Write-Output "build: Package version prefix is $versionPrefix"
1721

18-
foreach ($src in ls src/*) {
19-
Push-Location $src
22+
$branch = @{ $true = $env:CI_TARGET_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$NULL -ne $env:CI_TARGET_BRANCH];
23+
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:CI_BUILD_NUMBER, 10); $false = "local" }[$NULL -ne $env:CI_BUILD_NUMBER];
24+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)) -replace '([^a-zA-Z0-9\-]*)', '')-$revision"}[$branch -eq "main" -and $revision -ne "local"]
2025

21-
echo "build: Packaging project in $src"
26+
Write-Output "build: Package version suffix is $suffix"
2227

23-
if ($suffix) {
24-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
25-
} else {
26-
& dotnet pack -c Release -o ..\..\artifacts
27-
}
28-
29-
if($LASTEXITCODE -ne 0) { exit 1 }
30-
31-
Pop-Location
28+
if ($suffix) {
29+
& dotnet build -c Release --version-suffix=$suffix /p:ContinuousIntegrationBuild=true
30+
} else {
31+
& dotnet build -c Release /p:ContinuousIntegrationBuild=true
3232
}
3333

34-
foreach ($test in ls test/*.PerformanceTests) {
35-
Push-Location $test
34+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
3635

37-
echo "build: Building performance test project in $test"
36+
foreach ($src in Get-ChildItem src/*) {
37+
Push-Location $src
3838

39-
& dotnet build -c Release
40-
if($LASTEXITCODE -ne 0) { exit 2 }
39+
Write-Output "build: Packaging project in $src"
40+
if ($suffix) {
41+
& dotnet pack -c Release --no-build --no-restore -o ../../artifacts --version-suffix=$suffix
42+
} else {
43+
& dotnet pack -c Release --no-build --no-restore -o ../../artifacts
44+
}
45+
if($LASTEXITCODE -ne 0) { throw "Packaging failed" }
4146

4247
Pop-Location
4348
}
4449

45-
foreach ($test in ls test/*.Tests) {
50+
foreach ($test in Get-ChildItem test/*.Tests) {
4651
Push-Location $test
4752

48-
echo "build: Testing project in $test"
53+
Write-Output "build: Testing project in $test"
4954

5055
& dotnet test -c Release
51-
if($LASTEXITCODE -ne 0) { exit 3 }
56+
if($LASTEXITCODE -ne 0) { throw "Testing failed" }
5257

5358
Pop-Location
5459
}
5560

5661
Pop-Location
62+
63+
if ($env:NUGET_API_KEY) {
64+
# GitHub Actions will only supply this to branch builds and not PRs. We publish
65+
# builds from any branch this action targets (i.e. main and dev).
66+
67+
Write-Output "build: Publishing NuGet packages"
68+
69+
foreach ($nupkg in Get-ChildItem artifacts/*.nupkg) {
70+
& dotnet nuget push -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json "$nupkg"
71+
if($LASTEXITCODE -ne 0) { throw "Publishing failed" }
72+
}
73+
74+
if (!($suffix)) {
75+
Write-Output "build: Creating release for version $versionPrefix"
76+
77+
iex "gh release create v$versionPrefix --title v$versionPrefix --generate-notes $(get-item ./artifacts/*.nupkg) $(get-item ./artifacts/*.snupkg)"
78+
}
79+
}

Directory.Build.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<PropertyGroup>
3+
<VersionPrefix>9.0.0</VersionPrefix>
4+
<LangVersion>latest</LangVersion>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
</Project>

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Seq.Extensions.Logging [![Build status](https://ci.appveyor.com/api/projects/status/h7r1hv3cpd6e2ou3?svg=true)](https://ci.appveyor.com/project/datalust/seq-extensions-logging) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Seq.Extensions.Logging.svg)](https://nuget.org/packages/Seq.Extensions.Logging)
1+
# Seq.Extensions.Logging [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Seq.Extensions.Logging.svg)](https://nuget.org/packages/Seq.Extensions.Logging)
22

33
[Seq](https://datalust.co/seq) is a flexible self-hosted back-end for the ASP.NET Core logging subsystem (_Microsoft.Extensions.Logging_). Log events generated by the framework and application code are sent over HTTP to a Seq server, where the structured data associated with each event is used for powerful filtering, correlation, and analysis.
44

@@ -126,6 +126,17 @@ builder.Logging.Configure(opts => {
126126
});
127127
```
128128

129+
### Enrichment
130+
131+
You can add additional structured data to events being sent to Seq by specifying _enricher_ callbacks in the `AddSeq()` method:
132+
133+
```csharp
134+
.AddSeq(enrichers: [evt => evt.AddOrUpdateProperty(
135+
"ThreadId",
136+
Environment.CurrentManagedThreadId)
137+
]))
138+
```
139+
129140
### Troubleshooting
130141

131142
> Nothing showed up, what can I do?
@@ -170,5 +181,5 @@ you're targeting `net8.0`, target a 8.* version of _Seq.Extensions.Logging_ for
170181

171182
### Credits
172183

173-
This package is based on a subset of the powerful [Serilog](https://serilog.net) library. Not all of the options supported by the Serilog and Seq client libraries are present in
174-
the _Seq.Extensions.Logging_ package.
184+
This package is based on a subset of [Serilog](https://serilog.net). Not all of the options supported by the Serilog and Seq client
185+
libraries are present in the _Seq.Extensions.Logging_ package.

appveyor.yml

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

example/ConsoleExample/ConsoleExample.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
13-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
11+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

example/WebExample/WebExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "9.0.100",
44
"rollForward": "latestFeature"
55
}
66
}

seq-extensions-logging.sln

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0069BFD6-B0E
66
EndProject
77
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{B0D573D8-1AE2-4C5C-817A-95815067452E}"
88
ProjectSection(SolutionItems) = preProject
9-
appveyor.yml = appveyor.yml
10-
Build.ps1 = Build.ps1
119
LICENSE = LICENSE
1210
README.md = README.md
1311
global.json = global.json
1412
.gitattributes = .gitattributes
1513
.gitignore = .gitignore
14+
Directory.Build.props = Directory.Build.props
15+
Build.ps1 = Build.ps1
1616
EndProjectSection
1717
EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D54DE844-AC36-4872-928F-5F573D41ACAE}"
@@ -27,6 +27,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebExample", "example\WebEx
2727
EndProject
2828
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleExample", "example\ConsoleExample\ConsoleExample.csproj", "{3C7C4F1B-7BB1-48F6-BC9E-0A81F632458B}"
2929
EndProject
30+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{98FB80CE-7AEF-4FA3-88D0-9812529BC15F}"
31+
EndProject
32+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{8BCBFBF7-24E1-491A-956E-1AC7E1183270}"
33+
ProjectSection(SolutionItems) = preProject
34+
.github\workflows\ci.yml = .github\workflows\ci.yml
35+
EndProjectSection
36+
EndProject
3037
Global
3138
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3239
Debug|Any CPU = Debug|Any CPU
@@ -58,6 +65,7 @@ Global
5865
{64A3F2C5-D71E-44A6-8DC7-99474765B32E} = {D54DE844-AC36-4872-928F-5F573D41ACAE}
5966
{FC44EC1F-AD83-4522-99B4-4B309B8CC78A} = {1C72E771-7C72-4A30-A408-5CE66E792ADF}
6067
{3C7C4F1B-7BB1-48F6-BC9E-0A81F632458B} = {1C72E771-7C72-4A30-A408-5CE66E792ADF}
68+
{8BCBFBF7-24E1-491A-956E-1AC7E1183270} = {98FB80CE-7AEF-4FA3-88D0-9812529BC15F}
6169
EndGlobalSection
6270
GlobalSection(ExtensibilityGlobals) = postSolution
6371
SolutionGuid = {A6DD7789-D2A5-43A4-A4FE-E138166E15C7}

seq-extensions-logging.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
22
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
3+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;&lt;/Policy&gt;</s:String>
4+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
35
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
46
<s:Boolean x:Key="/Default/UserDictionary/Words/=Datalust/@EntryIndexedValue">True</s:Boolean>
57
<s:Boolean x:Key="/Default/UserDictionary/Words/=Destructurer/@EntryIndexedValue">True</s:Boolean>

0 commit comments

Comments
 (0)