SAHB.GraphQLClient
SAHB.GraphQLClient copied to clipboard
Accessing the log messages
I see that some of the classes make use of LoggerFactory, and that an example app has a section "Using dependency injection and console logging". Is it possible to use the latter without the former? If so, could you maybe add a doc section about a basic method/example to grab these messages in the 'client' code?
The LoggerFactory interface is from Microsoft.Extensions.Logging which is for example used with ASP.net Core. The loggerfactory interface is injected using property injection like this:
new GraphQLFieldBuilder() { LoggerFactory = provider.GetService<ILoggerFactory>() }
The code is from here: https://github.com/sahb1239/SAHB.GraphQLClient/blob/develop/src/SAHB.GraphQLClient/GraphQLClientBuilder.cs#L28
Some examples of using loggerfactory can be found here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.0