diff options
| author | JPVenson <github@jpb.email> | 2025-06-09 04:52:39 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-08 19:52:39 -0600 |
| commit | 1e9e4ffda9abe30b71ceb1de2f4c3143805c66a9 (patch) | |
| tree | c48fe1dd38a35efe225b1423fbcc295436b87f3b /tests | |
| parent | d7faf9a327f506a770afce6709327daf5cc9bc30 (diff) | |
Rework startup topic handling and reenable output to logging framework (#14243)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs index 725e359d7..0952fb8b6 100644 --- a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs +++ b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs @@ -98,7 +98,10 @@ namespace Jellyfin.Server.Integration.Tests .AddEnvironmentVariables("JELLYFIN_") .AddInMemoryCollection(commandLineOpts.ConvertToConfig()); }) - .ConfigureServices(e => e.AddSingleton<IStartupLogger, NullStartupLogger>().AddSingleton(e)); + .ConfigureServices(e => e + .AddSingleton<IStartupLogger, NullStartupLogger<object>>() + .AddTransient(typeof(IStartupLogger<>), typeof(NullStartupLogger<>)) + .AddSingleton(e)); } /// <inheritdoc/> @@ -132,13 +135,20 @@ namespace Jellyfin.Server.Integration.Tests base.Dispose(disposing); } - private sealed class NullStartupLogger : IStartupLogger + private sealed class NullStartupLogger<TCategory> : IStartupLogger<TCategory> { + public StartupLogTopic? Topic => throw new NotImplementedException(); + public IStartupLogger BeginGroup(FormattableString logEntry) { return this; } + public IStartupLogger<TCategory1> BeginGroup<TCategory1>(FormattableString logEntry) + { + return new NullStartupLogger<TCategory1>(); + } + public IDisposable? BeginScope<TState>(TState state) where TState : notnull { @@ -160,10 +170,25 @@ namespace Jellyfin.Server.Integration.Tests return this; } + public IStartupLogger<TCategory1> With<TCategory1>(Microsoft.Extensions.Logging.ILogger logger) + { + return new NullStartupLogger<TCategory1>(); + } + + IStartupLogger<TCategory> IStartupLogger<TCategory>.BeginGroup(FormattableString logEntry) + { + return new NullStartupLogger<TCategory>(); + } + IStartupLogger IStartupLogger.With(Microsoft.Extensions.Logging.ILogger logger) { return this; } + + IStartupLogger<TCategory> IStartupLogger<TCategory>.With(Microsoft.Extensions.Logging.ILogger logger) + { + return this; + } } } } |
