Replace ILogger with ILogger<T> wherever possible

Log entries will contain additional class context when using this interface
This commit is contained in:
Mark Monteiro
2020-03-03 23:07:10 +01:00
parent 5276c75cde
commit b67e9cde8c
86 changed files with 261 additions and 93 deletions

View File

@@ -20,7 +20,11 @@ namespace Emby.Server.Implementations.Channels
private readonly ILogger _logger;
private readonly ILibraryManager _libraryManager;
public RefreshChannelsScheduledTask(IChannelManager channelManager, IUserManager userManager, ILogger logger, ILibraryManager libraryManager)
public RefreshChannelsScheduledTask(
IChannelManager channelManager,
IUserManager userManager,
ILogger<RefreshChannelsScheduledTask> logger,
ILibraryManager libraryManager)
{
_channelManager = channelManager;
_userManager = userManager;

View File

@@ -348,7 +348,10 @@ namespace Emby.Server.Implementations.Collections
private readonly IServerConfigurationManager _config;
private readonly ILogger _logger;
public CollectionManagerEntryPoint(ICollectionManager collectionManager, IServerConfigurationManager config, ILogger logger)
public CollectionManagerEntryPoint(
ICollectionManager collectionManager,
IServerConfigurationManager config,
ILogger<CollectionManagerEntryPoint> logger)
{
_collectionManager = (CollectionManager)collectionManager;
_config = config;

View File

@@ -15,7 +15,7 @@ namespace Emby.Server.Implementations.Data
private readonly ILibraryManager _libraryManager;
private readonly ILogger _logger;
public CleanDatabaseScheduledTask(ILibraryManager libraryManager, ILogger logger)
public CleanDatabaseScheduledTask(ILibraryManager libraryManager, ILogger<CleanDatabaseScheduledTask> logger)
{
_libraryManager = libraryManager;
_logger = logger;

View File

@@ -407,7 +407,10 @@ namespace Emby.Server.Implementations.Devices
private readonly IServerConfigurationManager _config;
private ILogger _logger;
public DeviceManagerEntryPoint(IDeviceManager deviceManager, IServerConfigurationManager config, ILogger logger)
public DeviceManagerEntryPoint(
IDeviceManager deviceManager,
IServerConfigurationManager config,
ILogger<DeviceManagerEntryPoint> logger)
{
_deviceManager = (DeviceManager)deviceManager;
_config = config;

View File

@@ -56,7 +56,12 @@ namespace Emby.Server.Implementations.EntryPoints
private readonly IProviderManager _providerManager;
public LibraryChangedNotifier(ILibraryManager libraryManager, ISessionManager sessionManager, IUserManager userManager, ILogger logger, IProviderManager providerManager)
public LibraryChangedNotifier(
ILibraryManager libraryManager,
ISessionManager sessionManager,
IUserManager userManager,
ILogger<LibraryChangedNotifier> logger,
IProviderManager providerManager)
{
_libraryManager = libraryManager;
_sessionManager = sessionManager;

View File

@@ -20,7 +20,11 @@ namespace Emby.Server.Implementations.EntryPoints
private readonly IUserManager _userManager;
private readonly ILogger _logger;
public RecordingNotifier(ISessionManager sessionManager, IUserManager userManager, ILogger logger, ILiveTvManager liveTvManager)
public RecordingNotifier(
ISessionManager sessionManager,
IUserManager userManager,
ILogger<RecordingNotifier> logger,
ILiveTvManager liveTvManager)
{
_sessionManager = sessionManager;
_userManager = userManager;

View File

@@ -27,7 +27,11 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
/// <param name="fileSystem">The file system.</param>
/// <param name="libraryManager">The library manager.</param>
/// <param name="config">The configuration manager.</param>
public MusicArtistResolver(ILogger logger, IFileSystem fileSystem, ILibraryManager libraryManager, IServerConfigurationManager config)
public MusicArtistResolver(
ILogger<MusicArtistResolver> logger,
IFileSystem fileSystem,
ILibraryManager libraryManager,
IServerConfigurationManager config)
{
_logger = logger;
_fileSystem = fileSystem;

View File

@@ -25,7 +25,11 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
/// <param name="libraryManager">The library manager.</param>
/// <param name="localization">The localization</param>
/// <param name="logger">The logger</param>
public SeasonResolver(IServerConfigurationManager config, ILibraryManager libraryManager, ILocalizationManager localization, ILogger logger)
public SeasonResolver(
IServerConfigurationManager config,
ILibraryManager libraryManager,
ILocalizationManager localization,
ILogger<SeasonResolver> logger)
{
_config = config;
_libraryManager = libraryManager;

View File

@@ -31,7 +31,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
/// <param name="fileSystem">The file system.</param>
/// <param name="logger">The logger.</param>
/// <param name="libraryManager">The library manager.</param>
public SeriesResolver(IFileSystem fileSystem, ILogger logger, ILibraryManager libraryManager)
public SeriesResolver(IFileSystem fileSystem, ILogger<SeriesResolver> logger, ILibraryManager libraryManager)
{
_fileSystem = fileSystem;
_logger = logger;

View File

@@ -25,7 +25,10 @@ namespace Emby.Server.Implementations.Library.Validators
/// <param name="libraryManager">The library manager.</param>
/// <param name="logger">The logger.</param>
/// <param name="itemRepo">The item repository.</param>
public ArtistsPostScanTask(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo)
public ArtistsPostScanTask(
ILibraryManager libraryManager,
ILogger<ArtistsPostScanTask> logger,
IItemRepository itemRepo)
{
_libraryManager = libraryManager;
_logger = logger;

View File

@@ -25,7 +25,10 @@ namespace Emby.Server.Implementations.Library.Validators
/// <param name="libraryManager">The library manager.</param>
/// <param name="logger">The logger.</param>
/// <param name="itemRepo">The item repository.</param>
public GenresPostScanTask(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo)
public GenresPostScanTask(
ILibraryManager libraryManager,
ILogger<GenresPostScanTask> logger,
IItemRepository itemRepo)
{
_libraryManager = libraryManager;
_logger = logger;

View File

@@ -25,7 +25,10 @@ namespace Emby.Server.Implementations.Library.Validators
/// <param name="libraryManager">The library manager.</param>
/// <param name="logger">The logger.</param>
/// <param name="itemRepo">The item repository.</param>
public MusicGenresPostScanTask(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo)
public MusicGenresPostScanTask(
ILibraryManager libraryManager,
ILogger<MusicGenresPostScanTask> logger,
IItemRepository itemRepo)
{
_libraryManager = libraryManager;
_logger = logger;

View File

@@ -26,7 +26,10 @@ namespace Emby.Server.Implementations.Library.Validators
/// <param name="libraryManager">The library manager.</param>
/// <param name="logger">The logger.</param>
/// <param name="itemRepo">The item repository.</param>
public StudiosPostScanTask(ILibraryManager libraryManager, ILogger logger, IItemRepository itemRepo)
public StudiosPostScanTask(
ILibraryManager libraryManager,
ILogger<StudiosPostScanTask> logger,
IItemRepository itemRepo)
{
_libraryManager = libraryManager;
_logger = logger;

View File

@@ -80,7 +80,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
IServerApplicationHost appHost,
IStreamHelper streamHelper,
IMediaSourceManager mediaSourceManager,
ILogger logger,
ILogger<EmbyTV> logger,
IJsonSerializer jsonSerializer,
IHttpClient httpClient,
IServerConfigurationManager config,

View File

@@ -33,7 +33,11 @@ namespace Emby.Server.Implementations.LiveTv.Listings
private const string ApiUrl = "https://json.schedulesdirect.org/20141201";
public SchedulesDirect(ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IApplicationHost appHost)
public SchedulesDirect(
ILogger<SchedulesDirect> logger,
IJsonSerializer jsonSerializer,
IHttpClient httpClient,
IApplicationHost appHost)
{
_logger = logger;
_jsonSerializer = jsonSerializer;

View File

@@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
public XmlTvListingsProvider(
IServerConfigurationManager config,
IHttpClient httpClient,
ILogger logger,
ILogger<XmlTvListingsProvider> logger,
IFileSystem fileSystem,
IZipClient zipClient)
{

View File

@@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
public HdHomerunHost(
IServerConfigurationManager config,
ILogger logger,
ILogger<HdHomerunHost> logger,
IJsonSerializer jsonSerializer,
IFileSystem fileSystem,
IHttpClient httpClient,

View File

@@ -33,14 +33,14 @@ namespace Emby.Server.Implementations.Playlists
ILibraryManager libraryManager,
IFileSystem fileSystem,
ILibraryMonitor iLibraryMonitor,
ILoggerFactory loggerFactory,
ILogger<PlaylistManager> logger,
IUserManager userManager,
IProviderManager providerManager)
{
_libraryManager = libraryManager;
_fileSystem = fileSystem;
_iLibraryMonitor = iLibraryMonitor;
_logger = loggerFactory.CreateLogger(nameof(PlaylistManager));
_logger = logger;
_userManager = userManager;
_providerManager = providerManager;
}

View File

@@ -29,7 +29,10 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
/// <summary>
/// Initializes a new instance of the <see cref="DeleteCacheFileTask" /> class.
/// </summary>
public DeleteCacheFileTask(IApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem)
public DeleteCacheFileTask(
IApplicationPaths appPaths,
ILogger<DeleteCacheFileTask> logger,
IFileSystem fileSystem)
{
ApplicationPaths = appPaths;
_logger = logger;

View File

@@ -23,7 +23,10 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
/// <summary>
/// Initializes a new instance of the <see cref="DeleteTranscodeFileTask" /> class.
/// </summary>
public DeleteTranscodeFileTask(ILogger logger, IFileSystem fileSystem, IConfigurationManager configurationManager)
public DeleteTranscodeFileTask(
ILogger<DeleteTranscodeFileTask> logger,
IFileSystem fileSystem,
IConfigurationManager configurationManager)
{
_logger = logger;
_fileSystem = fileSystem;

View File

@@ -23,7 +23,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
private readonly IInstallationManager _installationManager;
public PluginUpdateTask(ILogger logger, IInstallationManager installationManager)
public PluginUpdateTask(ILogger<PluginUpdateTask> logger, IInstallationManager installationManager)
{
_logger = logger;
_installationManager = installationManager;