Logging
DealCloudSDK
also optionally accepts an ILogger
in its constructor definition. This means that the logging output of the SDK can be configured as desired, using this interface.
For example, using a console logger:
using DealCloudSDK;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
var config = new ConfigurationBuilder()
.AddJsonFile("environment_config.json")
.Build();
// define logger of your choosing
using var factory = LoggerFactory.Create(builder => builder
.AddConsole());
var logger = factory.CreateLogger("Program");
// pass the ILogger as an argument to the constructor.
var dc = new Client(config, logger);