discord-net / Discord.Net

An unofficial .Net wrapper for the Discord API (https://discord.com/)
https://discordnet.dev
MIT License
3.34k stars 734 forks source link

Give threads names #1452

Closed lewisakura closed 4 years ago

lewisakura commented 4 years ago

I am using Serilog as a logging library for my bot, and I have had to write a custom enricher (a way of adding properties to a log line) to override thread names with a custom name because Discord.Net does not name its threads. I have a feeling that some other people may use thread names for a similar purpose and it might just be better to, as well as give it to the LogMessage.Source parameter, also name the threads that provide log lines.

FiniteReality commented 4 years ago

Discord.Net works entirely within the default ThreadPool and uses the TPL. There is no way to name the threads unless you use your own ThreadPool implementation.