aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/ServerSetupApp/IStartupLogger.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-06-09 04:52:39 +0300
committerGitHub <noreply@github.com>2025-06-08 19:52:39 -0600
commit1e9e4ffda9abe30b71ceb1de2f4c3143805c66a9 (patch)
treec48fe1dd38a35efe225b1423fbcc295436b87f3b /Jellyfin.Server/ServerSetupApp/IStartupLogger.cs
parentd7faf9a327f506a770afce6709327daf5cc9bc30 (diff)
Rework startup topic handling and reenable output to logging framework (#14243)
Diffstat (limited to 'Jellyfin.Server/ServerSetupApp/IStartupLogger.cs')
-rw-r--r--Jellyfin.Server/ServerSetupApp/IStartupLogger.cs43
1 files changed, 42 insertions, 1 deletions
diff --git a/Jellyfin.Server/ServerSetupApp/IStartupLogger.cs b/Jellyfin.Server/ServerSetupApp/IStartupLogger.cs
index 2c2ef05f8..e7c193936 100644
--- a/Jellyfin.Server/ServerSetupApp/IStartupLogger.cs
+++ b/Jellyfin.Server/ServerSetupApp/IStartupLogger.cs
@@ -1,5 +1,4 @@
using System;
-using Morestachio.Helper.Logging;
using ILogger = Microsoft.Extensions.Logging.ILogger;
namespace Jellyfin.Server.ServerSetupApp;
@@ -10,6 +9,11 @@ namespace Jellyfin.Server.ServerSetupApp;
public interface IStartupLogger : ILogger
{
/// <summary>
+ /// Gets the topic this logger is assigned to.
+ /// </summary>
+ StartupLogTopic? Topic { get; }
+
+ /// <summary>
/// Adds another logger instance to this logger for combined logging.
/// </summary>
/// <param name="logger">Other logger to rely messages to.</param>
@@ -22,4 +26,41 @@ public interface IStartupLogger : ILogger
/// <param name="logEntry">Defines the log message that introduces the new group.</param>
/// <returns>A new logger that can write to the group.</returns>
IStartupLogger BeginGroup(FormattableString logEntry);
+
+ /// <summary>
+ /// Adds another logger instance to this logger for combined logging.
+ /// </summary>
+ /// <param name="logger">Other logger to rely messages to.</param>
+ /// <returns>A combined logger.</returns>
+ /// <typeparam name="TCategory">The logger cateogry.</typeparam>
+ IStartupLogger<TCategory> With<TCategory>(ILogger logger);
+
+ /// <summary>
+ /// Opens a new Group logger within the parent logger.
+ /// </summary>
+ /// <param name="logEntry">Defines the log message that introduces the new group.</param>
+ /// <returns>A new logger that can write to the group.</returns>
+ /// <typeparam name="TCategory">The logger cateogry.</typeparam>
+ IStartupLogger<TCategory> BeginGroup<TCategory>(FormattableString logEntry);
+}
+
+/// <summary>
+/// Defines a logger that can be injected via DI to get a startup logger initialised with an logger framework connected <see cref="ILogger"/>.
+/// </summary>
+/// <typeparam name="TCategory">The logger cateogry.</typeparam>
+public interface IStartupLogger<TCategory> : IStartupLogger
+{
+ /// <summary>
+ /// Adds another logger instance to this logger for combined logging.
+ /// </summary>
+ /// <param name="logger">Other logger to rely messages to.</param>
+ /// <returns>A combined logger.</returns>
+ new IStartupLogger<TCategory> With(ILogger logger);
+
+ /// <summary>
+ /// Opens a new Group logger within the parent logger.
+ /// </summary>
+ /// <param name="logEntry">Defines the log message that introduces the new group.</param>
+ /// <returns>A new logger that can write to the group.</returns>
+ new IStartupLogger<TCategory> BeginGroup(FormattableString logEntry);
}