Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Handle logging instance while creating nuget package

$
0
0

I'm creating new nuget package for one of my class library project called CustomersClient where I have constructor with parameters and one of the parameter is ILogger

    public CustomerClient(ILogger<CustomerClient> logger, ICustomerClientOptions options, HttpClient httpClient)    {        _logger = logger;        _options = options;        _httpClient = httpClient;    }

another constructor without log

    public CustomerClient(ICustomerClientOptions options, HttpClient httpClient)    {        _options = options;        _httpClient = httpClient;    }   public void LogMessage(string msg)    {        _logger.LogInformation($"{msg}");    }

How do I use logging instance without DI ?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>