diff options
| author | William Taylor <me@willtaylor.info> | 2019-01-17 22:55:05 +0000 |
|---|---|---|
| committer | William Taylor <me@willtaylor.info> | 2019-01-20 21:05:12 +0000 |
| commit | 65cd3ed597c60503a517c06ad16c933ebf2434a9 (patch) | |
| tree | 772d1d8d1b77a2363500dde7cf5a4d572fdf968f /Jellyfin.Server/Program.cs | |
| parent | 0586598d33ea5eeed36259fe970a7e3184f6b087 (diff) | |
Replaced injections of ILogger with ILoggerFactory
This makes resolving dependencies from the container much easier as
you cannot resolve with primitives parameters in a way that is any
more readable.
The aim of this commit is to change as little as possible with the end
result, loggers that were newed up for the parent object were given the same
name. Objects that used the base or app loggers, were given a new logger with
an appropriate name.
Also removed some unused dependencies.
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index d07761619..573c63385 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -89,7 +89,7 @@ namespace Jellyfin.Server // Allow all https requests ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; }); - var fileSystem = new ManagedFileSystem(_loggerFactory.CreateLogger("FileSystem"), environmentInfo, null, appPaths.TempDirectory, true); + var fileSystem = new ManagedFileSystem(_loggerFactory, environmentInfo, null, appPaths.TempDirectory, true); using (var appHost = new CoreAppHost( appPaths, @@ -98,12 +98,12 @@ namespace Jellyfin.Server fileSystem, environmentInfo, new NullImageEncoder(), - new SystemEvents(_loggerFactory.CreateLogger("SystemEvents")), - new NetworkManager(_loggerFactory.CreateLogger("NetworkManager"), environmentInfo))) + new SystemEvents(), + new NetworkManager(_loggerFactory, environmentInfo))) { appHost.Init(); - appHost.ImageProcessor.ImageEncoder = getImageEncoder(_logger, fileSystem, options, () => appHost.HttpClient, appPaths, environmentInfo, appHost.LocalizationManager); + appHost.ImageProcessor.ImageEncoder = getImageEncoder(_loggerFactory, fileSystem, options, () => appHost.HttpClient, appPaths, environmentInfo, appHost.LocalizationManager); _logger.LogInformation("Running startup tasks"); @@ -257,7 +257,7 @@ namespace Jellyfin.Server } public static IImageEncoder getImageEncoder( - ILogger logger, + ILoggerFactory loggerFactory, IFileSystem fileSystem, StartupOptions startupOptions, Func<IHttpClient> httpClient, @@ -267,11 +267,11 @@ namespace Jellyfin.Server { try { - return new SkiaEncoder(logger, appPaths, httpClient, fileSystem, localizationManager); + return new SkiaEncoder(loggerFactory, appPaths, httpClient, fileSystem, localizationManager); } catch (Exception ex) { - logger.LogInformation(ex, "Skia not available. Will fallback to NullIMageEncoder. {0}"); + _logger.LogInformation(ex, "Skia not available. Will fallback to NullIMageEncoder. {0}"); } return new NullImageEncoder(); |
