diff --git a/BunsenBurner.AutoFixture/BunsenBurner.AutoFixture.csproj b/BunsenBurner.AutoFixture/BunsenBurner.AutoFixture.csproj index 7e3d857..15f2227 100644 --- a/BunsenBurner.AutoFixture/BunsenBurner.AutoFixture.csproj +++ b/BunsenBurner.AutoFixture/BunsenBurner.AutoFixture.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Background/BunsenBurner.Background.csproj b/BunsenBurner.Background/BunsenBurner.Background.csproj index 92f4243..e5f2bf7 100644 --- a/BunsenBurner.Background/BunsenBurner.Background.csproj +++ b/BunsenBurner.Background/BunsenBurner.Background.csproj @@ -53,7 +53,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.BenchmarkDotNet/BunsenBurner.BenchmarkDotNet.csproj b/BunsenBurner.BenchmarkDotNet/BunsenBurner.BenchmarkDotNet.csproj index 00248fe..914562a 100644 --- a/BunsenBurner.BenchmarkDotNet/BunsenBurner.BenchmarkDotNet.csproj +++ b/BunsenBurner.BenchmarkDotNet/BunsenBurner.BenchmarkDotNet.csproj @@ -53,7 +53,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Bogus/BunsenBurner.Bogus.csproj b/BunsenBurner.Bogus/BunsenBurner.Bogus.csproj index 12ddda0..9bc721b 100644 --- a/BunsenBurner.Bogus/BunsenBurner.Bogus.csproj +++ b/BunsenBurner.Bogus/BunsenBurner.Bogus.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.DependencyInjection/BunsenBurner.DependencyInjection.csproj b/BunsenBurner.DependencyInjection/BunsenBurner.DependencyInjection.csproj index 9d67733..907a4b6 100644 --- a/BunsenBurner.DependencyInjection/BunsenBurner.DependencyInjection.csproj +++ b/BunsenBurner.DependencyInjection/BunsenBurner.DependencyInjection.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.FunctionApp/BunsenBurner.FunctionApp.csproj b/BunsenBurner.FunctionApp/BunsenBurner.FunctionApp.csproj index cdad6bf..42e9ab3 100644 --- a/BunsenBurner.FunctionApp/BunsenBurner.FunctionApp.csproj +++ b/BunsenBurner.FunctionApp/BunsenBurner.FunctionApp.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Hedgehog/BunsenBurner.Hedgehog.csproj b/BunsenBurner.Hedgehog/BunsenBurner.Hedgehog.csproj index d0e4959..3239171 100644 --- a/BunsenBurner.Hedgehog/BunsenBurner.Hedgehog.csproj +++ b/BunsenBurner.Hedgehog/BunsenBurner.Hedgehog.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Http/BunsenBurner.Http.csproj b/BunsenBurner.Http/BunsenBurner.Http.csproj index 7ee4554..3c3c695 100644 --- a/BunsenBurner.Http/BunsenBurner.Http.csproj +++ b/BunsenBurner.Http/BunsenBurner.Http.csproj @@ -53,7 +53,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Logging/BunsenBurner.Logging.csproj b/BunsenBurner.Logging/BunsenBurner.Logging.csproj index 5cee1bc..34d2dff 100644 --- a/BunsenBurner.Logging/BunsenBurner.Logging.csproj +++ b/BunsenBurner.Logging/BunsenBurner.Logging.csproj @@ -55,7 +55,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Logging/DummyLogger.cs b/BunsenBurner.Logging/DummyLogger.cs index 33ffabe..fdadbdc 100644 --- a/BunsenBurner.Logging/DummyLogger.cs +++ b/BunsenBurner.Logging/DummyLogger.cs @@ -1,4 +1,5 @@ using System.Collections; +using System.Collections.Concurrent; using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.Logging; @@ -13,7 +14,7 @@ public sealed record DummyLogger : ILogger, IEnumerable, IDisp private readonly string _ownerClassName; private readonly LogMessageStore _store; private readonly Sink? _sink; - private IEnumerable _scopes = Enumerable.Empty(); + private readonly ConcurrentDictionary _scopes = new(); internal DummyLogger(LogMessageStore store, string ownerClassName, Sink? sink) { @@ -37,7 +38,7 @@ public void Log( eventId, exception, formatter(state, exception), - _scopes.Select(x => x.State) + _scopes.Keys.Select(x => x.State) ); _store.Log(message); _sink?.Write(message); @@ -49,22 +50,15 @@ public void Log( /// public IDisposable BeginScope(TState state) where TState : notnull { - lock (_scopes) - { - var scope = new Scope(state, this); - _scopes = _scopes.Append(scope); - return scope; - } + var scope = new Scope(state, this); + _scopes.AddOrUpdate(scope, _ => byte.MinValue, (_, b) => b); + return scope; } private sealed record Scope(object State, DummyLogger Parent) : IDisposable { [ExcludeFromCodeCoverage] - public void Dispose() - { - lock (Parent._scopes) - Parent._scopes = Parent._scopes.Where(x => x != this); - } + public void Dispose() => Parent._scopes.TryRemove(this, out _); } /// @@ -76,11 +70,9 @@ public void Dispose() /// public void Dispose() { - foreach (var scope in _scopes) - { + foreach (var scope in _scopes.Keys) scope.Dispose(); - } - _scopes = Enumerable.Empty(); + _scopes.Clear(); } } diff --git a/BunsenBurner.NUnit/BunsenBurner.NUnit.csproj b/BunsenBurner.NUnit/BunsenBurner.NUnit.csproj index 26ba2bc..13f033a 100644 --- a/BunsenBurner.NUnit/BunsenBurner.NUnit.csproj +++ b/BunsenBurner.NUnit/BunsenBurner.NUnit.csproj @@ -53,7 +53,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Verify.NUnit/BunsenBurner.Verify.NUnit.csproj b/BunsenBurner.Verify.NUnit/BunsenBurner.Verify.NUnit.csproj index 27d886a..20804ec 100644 --- a/BunsenBurner.Verify.NUnit/BunsenBurner.Verify.NUnit.csproj +++ b/BunsenBurner.Verify.NUnit/BunsenBurner.Verify.NUnit.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Verify.Xunit/BunsenBurner.Verify.Xunit.csproj b/BunsenBurner.Verify.Xunit/BunsenBurner.Verify.Xunit.csproj index 1fdcf8b..6df507a 100644 --- a/BunsenBurner.Verify.Xunit/BunsenBurner.Verify.Xunit.csproj +++ b/BunsenBurner.Verify.Xunit/BunsenBurner.Verify.Xunit.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner.Xunit/BunsenBurner.Xunit.csproj b/BunsenBurner.Xunit/BunsenBurner.Xunit.csproj index 4a6e60d..5390b4a 100644 --- a/BunsenBurner.Xunit/BunsenBurner.Xunit.csproj +++ b/BunsenBurner.Xunit/BunsenBurner.Xunit.csproj @@ -53,7 +53,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BunsenBurner/BunsenBurner.csproj b/BunsenBurner/BunsenBurner.csproj index 69aaccc..632327b 100644 --- a/BunsenBurner/BunsenBurner.csproj +++ b/BunsenBurner/BunsenBurner.csproj @@ -52,7 +52,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/commitlint.config.js b/commitlint.config.js index fb78885..f8f2676 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,8 +1,8 @@ module.exports = { extends: ['@commitlint/config-conventional'], rules: { - "header-case": [1, "always", "sentence-case"], - "header-max-length": [2, "always", 100], + "subject-case": [0, 'never'], + "subject-max-length": [2, "always", 100], "scope-enum": _ => [ 2, "always",