mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
fix log window setting
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using SimpleInjector;
|
||||
@@ -18,6 +19,18 @@ namespace MediaBrowser.Common.Implementations
|
||||
/// <value>The logger.</value>
|
||||
public ILogger Logger { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the log manager.
|
||||
/// </summary>
|
||||
/// <value>The log manager.</value>
|
||||
public ILogManager LogManager { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the application paths.
|
||||
/// </summary>
|
||||
/// <value>The application paths.</value>
|
||||
protected IApplicationPaths ApplicationPaths { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The container
|
||||
/// </summary>
|
||||
@@ -45,6 +58,12 @@ namespace MediaBrowser.Common.Implementations
|
||||
/// </summary>
|
||||
protected readonly List<IDisposable> DisposableParts = new List<IDisposable>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is first run.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
|
||||
public bool IsFirstRun { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The _protobuf serializer initialized
|
||||
/// </summary>
|
||||
@@ -82,6 +101,16 @@ namespace MediaBrowser.Common.Implementations
|
||||
protected BaseApplicationHost()
|
||||
{
|
||||
FailedAssemblies = new List<string>();
|
||||
|
||||
ApplicationPaths = GetApplicationPaths();
|
||||
|
||||
LogManager = GetLogManager();
|
||||
|
||||
Logger = LogManager.GetLogger("App");
|
||||
|
||||
IsFirstRun = !File.Exists(ApplicationPaths.SystemConfigurationFilePath);
|
||||
|
||||
DiscoverTypes();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -90,6 +119,18 @@ namespace MediaBrowser.Common.Implementations
|
||||
/// <returns>IEnumerable{Assembly}.</returns>
|
||||
protected abstract IEnumerable<Assembly> GetComposablePartAssemblies();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the log manager.
|
||||
/// </summary>
|
||||
/// <returns>ILogManager.</returns>
|
||||
protected abstract ILogManager GetLogManager();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the application paths.
|
||||
/// </summary>
|
||||
/// <returns>IApplicationPaths.</returns>
|
||||
protected abstract IApplicationPaths GetApplicationPaths();
|
||||
|
||||
/// <summary>
|
||||
/// Discovers the types.
|
||||
/// </summary>
|
||||
|
||||
@@ -14,25 +14,32 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||
public class ReloadLoggerFileTask : IScheduledTask
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the kernel.
|
||||
/// Gets or sets the log manager.
|
||||
/// </summary>
|
||||
/// <value>The kernel.</value>
|
||||
private IKernel Kernel { get; set; }
|
||||
/// <value>The log manager.</value>
|
||||
private ILogManager LogManager { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the logger.
|
||||
/// </summary>
|
||||
/// <value>The logger.</value>
|
||||
private ILogger Logger { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the kernel.
|
||||
/// </summary>
|
||||
/// <value>The kernel.</value>
|
||||
private IKernel Kernel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReloadLoggerFileTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="kernel">The kernel.</param>
|
||||
/// <param name="logManager">The logManager.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
public ReloadLoggerFileTask(IKernel kernel, ILogger logger)
|
||||
/// <param name="kernel">The kernel.</param>
|
||||
public ReloadLoggerFileTask(ILogManager logManager, ILogger logger, IKernel kernel)
|
||||
{
|
||||
Kernel = kernel;
|
||||
LogManager = logManager;
|
||||
Logger = logger;
|
||||
Kernel = kernel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -57,8 +64,8 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
progress.Report(0);
|
||||
|
||||
return Task.Run(() => Kernel.ReloadLogger());
|
||||
|
||||
return Task.Run(() => LogManager.ReloadLogger(Kernel.Configuration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user