Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging via the ILogger interface #1227

Open
lorenzo93 opened this issue Mar 22, 2023 · 1 comment
Open

Add logging via the ILogger interface #1227

lorenzo93 opened this issue Mar 22, 2023 · 1 comment

Comments

@lorenzo93
Copy link

lorenzo93 commented Mar 22, 2023

Hi,

.NET has this beautiful interface called ILogger from the Microsoft.Extensions.Logging package. It is an interface which is implemented by all the most famous loggers in C#. Moreover, it is natively supported by the Dependency Injection framework internal to .NET.
This way, each programmer has the ability to use your bot connecting his preferred logger and having your internal messages logged.

I think it would be a great improvement :)

@tuscen
Copy link
Member

tuscen commented Mar 23, 2023

If you need to log client requests you can do it yourself using OnMakingApiRequest and OnApiResponseReceived events. They are async and have access to underlying HttpRequestMessage and HttpResponseMessage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants