mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
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.
This commit is contained in:
@@ -13,12 +13,11 @@ namespace Emby.Common.Implementations.Serialization
|
||||
public class JsonSerializer : IJsonSerializer
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public JsonSerializer(IFileSystem fileSystem, ILogger logger)
|
||||
public JsonSerializer(
|
||||
IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
_logger = logger;
|
||||
Configure();
|
||||
}
|
||||
|
||||
@@ -69,7 +68,6 @@ namespace Emby.Common.Implementations.Serialization
|
||||
|
||||
private static Stream OpenFile(string path)
|
||||
{
|
||||
//_logger.LogDebug("Deserializing file {0}", path);
|
||||
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 131072);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,12 @@ namespace Emby.Server.Implementations.Serialization
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public MyXmlSerializer(IFileSystem fileSystem, ILogger logger)
|
||||
public MyXmlSerializer(
|
||||
IFileSystem fileSystem,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
_logger = logger;
|
||||
_logger = loggerFactory.CreateLogger("XmlSerializer");
|
||||
}
|
||||
|
||||
// Need to cache these
|
||||
|
||||
Reference in New Issue
Block a user