diff --git a/src/ReC.Client/ReCClient.cs b/src/ReC.Client/ReCClient.cs index 7aa23a2..907d641 100644 --- a/src/ReC.Client/ReCClient.cs +++ b/src/ReC.Client/ReCClient.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using System; using System.Net.Http; using ReC.Client.Api; @@ -56,16 +57,21 @@ namespace ReC.Client /// Initializes a new instance of the class. /// /// The factory to create HttpClients. - public ReCClient(IHttpClientFactory httpClientFactory) + /// An optional logger used to record API call outcomes. +#if NETFRAMEWORK + public ReCClient(IHttpClientFactory httpClientFactory, ILogger logger = null) +#else + public ReCClient(IHttpClientFactory httpClientFactory, ILogger? logger = null) +#endif { _http = httpClientFactory.CreateClient(ClientName); - RecActions = new RecActionApi(_http); - Results = new ResultApi(_http); - Profiles = new ProfileApi(_http); - EndpointAuth = new EndpointAuthApi(_http); - EndpointParams = new EndpointParamsApi(_http); - Endpoints = new EndpointsApi(_http); - Common = new CommonApi(_http); + RecActions = new RecActionApi(_http, logger); + Results = new ResultApi(_http, logger); + Profiles = new ProfileApi(_http, logger); + EndpointAuth = new EndpointAuthApi(_http, logger); + EndpointParams = new EndpointParamsApi(_http, logger); + Endpoints = new EndpointsApi(_http, logger); + Common = new CommonApi(_http, logger); } #region Static