-
-
Notifications
You must be signed in to change notification settings - Fork 75
[FEAT]: Plugin Based Logging #434
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
base: main
Are you sure you want to change the base?
Conversation
|
I can definitely see benefits here, but I'm also curious if the multiple log files will make it more challenging to grab data from users when they need support. The functionality itself looks good, but will wait for @Core447 to chime in |
|
Nevermind, I see my confusion. This doesn't replace the base plugin logger, this creates a new logger specifically for troubleshooting. I think this is a good start, but I think this could be expanded upon a little more to make it more user friendly. Something like the following:
I think the only thing missing from your implementation is the ability to call the troubleshoot function from StreamController somewhere. I think this would be better than putting inside a specific action as we may want to troubleshoot some part of the plugin that is preventing actions from loading. |
|
I want to replace the Plugin Logger with this, its in my opinion a better way and it provides a dedicated "space" for every Plugin to use. Adding the button to the settings that starts a troubleshoot/diagnostic sounds like a good idea! Under I would create 2 methods: |
…d always showing a troubleshooting section
|
@ImDevinC could you take a look again? Added everything you wanted/needed |
|
This change now results in the following (Its a long line): The code for this is very simple: async def troubleshoot(self, *args, **kwargs):
self.log(f"Troubleshooting for action: {self.__class__.__name__} on ",
selected_device=self.selected_device,
device_filter=self.device_filter,
info_content=self.info_content,
show_info_content=self.show_info_content,
device_name=self.device_nick,
show_device_name=self.show_device_name,
use_standard=self.use_standard_device,
loaded_devices=self.loaded_devices,
icon_keys=self.icon_keys,
current_icon_name=self._icon_name) |
|
This looks great, thanks for putting it together so quickly! |
|
Alright opened it for merge! Now we just have to wait and see what @Core447 thinks |
This adds Plugin Based logging to StreamController.
It adds a log file for every plugin using loguru.
I added custom file retention as Im using date/time based log names that are different on every start. I did this because that makes it easy to only display the latest informations in the about window of the plugin