Add error logging for config setup#431
Conversation
…t-Py-V2 into config-error-notifications
a73534e to
a6a8eb1
Compare
adc7d1a to
12ed5fd
Compare
26865e6 to
221d2b6
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request adds error logging for configuration setup by integrating a Discord logging handler. The key changes are:
- Import and usage of a DiscordHandler to log errors to a Discord channel.
- Refactoring of the discord webhook setup function and its usage across configuration and startup.
- Enhanced error logging during environment variable setup in config.py.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| config.py | Refactored webhook setup for Discord logging and enhanced error handling. |
| cogs/startup.py | Adjusted DiscordHandler instantiation to use dynamic service naming. |
Comments suppressed due to low confidence (1)
config.py:181
- [nitpick] The function name '_setup_discord_log_channel_webhook' is now inconsistent with the setting key 'DISCORD_LOG_CHANNEL_WEBHOOK_URL'. Consider renaming the function to better reflect its purpose, such as '_configure_discord_logging_handler'.
def _setup_discord_log_channel_webhook(cls) -> "Logger":
There was a problem hiding this comment.
It might be nice to reorder the _setup_discord_log_channel_webhook() classmethod above all the other setup classmethods as this suggests it should get called before the other setup methods (as it does correctly in the _setup_env_variables() classmethod).
Entirely optional to do this, so have approved anyways (and disabled auto-merge to allow you to decide).
Have merged because as far as i could tell it was already in the correct order? though some of the others aren't so if i can be bothered I'll fix the rest as it's own separate PR anyway |
|
The call order is correct. I was referring to the definition order within the class. As in moving the |
No description provided.