bot
bot copied to clipboard
!ext-like command to change logging level
We currently have the !ext command to list, unload and load cogs.

It would be useful to have a similar command to lower the log level to DEBUG or TRACE during runtime.
Do note that some cog relies on other files like HelpChannel is actually made of four files. We need to find a way to detect those additional files and also change their logging level.
Do note that some cog relies on other files like
HelpChannelis actually made of four files. We need to find a way to detect those additional files and also change their logging level.
Setting the level on the parent logger of the package will make all the children inherit it so we don't need to discover those manually.
But I'm not sure how util logs should be handled with changing levels, for example the utils.lock will continue logging with the previous level even for information that is relevant to the ext where the level was changed, but then changing it will also cause logs from locks from all the other exts to change.
The schedulers also use the scheduler's name for the logger which should be taken care of
Setting the level on the parent logger of the package will make all the children inherit it so we don't need to discover those manually.
Cool, that should work then.
But I'm not sure how util logs should be handled with changing levels, for example the
utils.lockwill continue logging with the previous level even for information that is relevant to the ext where the level was changed, but then changing it will also cause logs from locks from all the other exts to change.
I think we should also be able to lower the logging level of utils just like with other cogs. It isn't an issue if we start logging calls from any cog.
I've never felt the need to change the log level during runtime at all, let alone for specific modules. This gives me the impression that it's a rare occurrence. In any case, is it not simple enough to do an internal eval to change the log level?
@Akarys42 would an acceptable implementation of this be per-cog?
Closed in 2025 review of open issues. We do not feel there is a large need for this feature.