mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
Change all ctor's to use IOcelotLoggerFactory
As part of #35 we are we are standardising on using IOcelotLoggerFactory over the default ILogger for DI purposes. Following a sln search, the use of ILogger was only found in one place (FileOcelotConfigurationCreator) and it's corresponding tests. This commit changes them and ensures the unit tests still pass.
This commit is contained in:
parent
c09cec67c6
commit
0ec7fc44ad
@ -9,6 +9,7 @@ using Ocelot.Configuration.File;
|
|||||||
using Ocelot.Configuration.Parser;
|
using Ocelot.Configuration.Parser;
|
||||||
using Ocelot.Configuration.Validator;
|
using Ocelot.Configuration.Validator;
|
||||||
using Ocelot.LoadBalancer.LoadBalancers;
|
using Ocelot.LoadBalancer.LoadBalancers;
|
||||||
|
using Ocelot.Logging;
|
||||||
using Ocelot.Requester.QoS;
|
using Ocelot.Requester.QoS;
|
||||||
using Ocelot.Responses;
|
using Ocelot.Responses;
|
||||||
using Ocelot.Utilities;
|
using Ocelot.Utilities;
|
||||||
@ -22,7 +23,7 @@ namespace Ocelot.Configuration.Creator
|
|||||||
{
|
{
|
||||||
private readonly IOptions<FileConfiguration> _options;
|
private readonly IOptions<FileConfiguration> _options;
|
||||||
private readonly IConfigurationValidator _configurationValidator;
|
private readonly IConfigurationValidator _configurationValidator;
|
||||||
private readonly ILogger<FileOcelotConfigurationCreator> _logger;
|
private readonly IOcelotLogger _logger;
|
||||||
private readonly ILoadBalancerFactory _loadBalanceFactory;
|
private readonly ILoadBalancerFactory _loadBalanceFactory;
|
||||||
private readonly ILoadBalancerHouse _loadBalancerHouse;
|
private readonly ILoadBalancerHouse _loadBalancerHouse;
|
||||||
private readonly IQoSProviderFactory _qoSProviderFactory;
|
private readonly IQoSProviderFactory _qoSProviderFactory;
|
||||||
@ -39,7 +40,7 @@ namespace Ocelot.Configuration.Creator
|
|||||||
public FileOcelotConfigurationCreator(
|
public FileOcelotConfigurationCreator(
|
||||||
IOptions<FileConfiguration> options,
|
IOptions<FileConfiguration> options,
|
||||||
IConfigurationValidator configurationValidator,
|
IConfigurationValidator configurationValidator,
|
||||||
ILogger<FileOcelotConfigurationCreator> logger,
|
IOcelotLoggerFactory loggerFactory,
|
||||||
ILoadBalancerFactory loadBalancerFactory,
|
ILoadBalancerFactory loadBalancerFactory,
|
||||||
ILoadBalancerHouse loadBalancerHouse,
|
ILoadBalancerHouse loadBalancerHouse,
|
||||||
IQoSProviderFactory qoSProviderFactory,
|
IQoSProviderFactory qoSProviderFactory,
|
||||||
@ -64,7 +65,7 @@ namespace Ocelot.Configuration.Creator
|
|||||||
_qosProviderHouse = qosProviderHouse;
|
_qosProviderHouse = qosProviderHouse;
|
||||||
_options = options;
|
_options = options;
|
||||||
_configurationValidator = configurationValidator;
|
_configurationValidator = configurationValidator;
|
||||||
_logger = logger;
|
_logger = loggerFactory.CreateLogger<FileOcelotConfigurationCreator>();
|
||||||
_claimsToThingCreator = claimsToThingCreator;
|
_claimsToThingCreator = claimsToThingCreator;
|
||||||
_serviceProviderConfigCreator = serviceProviderConfigCreator;
|
_serviceProviderConfigCreator = serviceProviderConfigCreator;
|
||||||
_qosOptionsCreator = qosOptionsCreator;
|
_qosOptionsCreator = qosOptionsCreator;
|
||||||
|
@ -8,6 +8,7 @@ using Ocelot.Configuration.Creator;
|
|||||||
using Ocelot.Configuration.File;
|
using Ocelot.Configuration.File;
|
||||||
using Ocelot.Configuration.Validator;
|
using Ocelot.Configuration.Validator;
|
||||||
using Ocelot.LoadBalancer.LoadBalancers;
|
using Ocelot.LoadBalancer.LoadBalancers;
|
||||||
|
using Ocelot.Logging;
|
||||||
using Ocelot.Requester.QoS;
|
using Ocelot.Requester.QoS;
|
||||||
using Ocelot.Responses;
|
using Ocelot.Responses;
|
||||||
using Shouldly;
|
using Shouldly;
|
||||||
@ -22,7 +23,7 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
private readonly Mock<IConfigurationValidator> _validator;
|
private readonly Mock<IConfigurationValidator> _validator;
|
||||||
private Response<IOcelotConfiguration> _config;
|
private Response<IOcelotConfiguration> _config;
|
||||||
private FileConfiguration _fileConfiguration;
|
private FileConfiguration _fileConfiguration;
|
||||||
private readonly Mock<ILogger<FileOcelotConfigurationCreator>> _logger;
|
private readonly Mock<IOcelotLoggerFactory> _logger;
|
||||||
private readonly FileOcelotConfigurationCreator _ocelotConfigurationCreator;
|
private readonly FileOcelotConfigurationCreator _ocelotConfigurationCreator;
|
||||||
private readonly Mock<ILoadBalancerFactory> _loadBalancerFactory;
|
private readonly Mock<ILoadBalancerFactory> _loadBalancerFactory;
|
||||||
private readonly Mock<ILoadBalancerHouse> _loadBalancerHouse;
|
private readonly Mock<ILoadBalancerHouse> _loadBalancerHouse;
|
||||||
@ -44,7 +45,7 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
_qosProviderFactory = new Mock<IQoSProviderFactory>();
|
_qosProviderFactory = new Mock<IQoSProviderFactory>();
|
||||||
_qosProviderHouse = new Mock<IQosProviderHouse>();
|
_qosProviderHouse = new Mock<IQosProviderHouse>();
|
||||||
_qosProvider = new Mock<IQoSProvider>();
|
_qosProvider = new Mock<IQoSProvider>();
|
||||||
_logger = new Mock<ILogger<FileOcelotConfigurationCreator>>();
|
_logger = new Mock<IOcelotLoggerFactory>();
|
||||||
_validator = new Mock<IConfigurationValidator>();
|
_validator = new Mock<IConfigurationValidator>();
|
||||||
_fileConfig = new Mock<IOptions<FileConfiguration>>();
|
_fileConfig = new Mock<IOptions<FileConfiguration>>();
|
||||||
_loadBalancerFactory = new Mock<ILoadBalancerFactory>();
|
_loadBalancerFactory = new Mock<ILoadBalancerFactory>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user