Add log level changed message when user changes Z-Wave JS log level#9238
Add log level changed message when user changes Z-Wave JS log level#9238bramkragten merged 6 commits intohome-assistant:devfrom
Conversation
|
Right now, I am updating the stored log level in the stored log config directly, but we could call _fetchData instead and retrieve the entire object from the server, with the idea being that theoretically the config could have been changed elsewhere. Only problem is that based on that logic, we will only know about the change when the user changes the dropdown. I've proposed adding an upstream event that gets sent whenever the log config gets updated that we could subscribe to here to keep the state up to date even if the config was changed elsewhere. That would also fix this bug. zwave-js/zwave-js#2672 |
|
I think this approach is fine. If a person is on the log view page, there's (in theory) little chance they'll change the log level somewhere else and not know or realize they changed it. |
src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts
Show resolved
Hide resolved
…ve_js-logs.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Proposed change
This is similar to #9062 in that when the user changes the log level on the logging UI page, there's no feedback to confirm that the log level actually changed. When you go from a more noisy to a less noisy log level in particular, it almost seems like something was broken.
I fixed a a bug that this exposed where you can't go back to the original log level that was set when you first loaded this page without a hard refresh. This is because we never updated the stored logConfig so setting it back to the original would
return early.
CC @cgarwood
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: