-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Debug option to enable logging server calls #17956
Debug option to enable logging server calls #17956
Conversation
This should just work! Wonder if we use log it in the console or make it visible on the screen, but for a first version, this seems perfect. This will btw not log everything, it only logs the things that are called through the |
I like the console because it has a lot more features than just displaying a log. E.g. if you receive a response with 1000 entries in it, you can copy it as a javascript object, and run things like filter and map commands on it right in the console.
Yeah I noticed that not all data is captured this way (even in DEV mode), I'd like to log those type of connections someday if possible too. |
Had a quick discussion with the design team about the debug panel in the dev tools, and we think placing it in an overflow menu makes the most sense, as it doesn't matches the other panels in dev tools. They can be used by the average user and this is really for developers. |
@@ -73,13 +73,14 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>( | |||
translationMetadata, | |||
dockedSidebar: "docked", | |||
vibrate: true, | |||
debugConnection: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should store this in localStorage
, now you will never be able to catch things when the page is refreshed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does including this in ha-pref-storage take care of that? I thought it was working when I tested it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, missed that 🙈 yeah pref storage stores that part in local storage!
You mean something like this? |
Yes, but in the top bar, so on the same height as |
…ts/frontend into frontend-debug-connection
Proposed change
In another PR we mused about a "debug" section of developer tools. I use heavily the logger which reports calls between the frontend and the HA server in debugging. If possible, thought it would be nice to have an option to enable this in release mode, and it seemed like a fit for this section. There are times when it could help debug issues.
Note I'm not actually confident if this works at all, perhaps something about the way the release is compiled will make this impossible, though it seems to work as intended when I try it in the dev build. So just wanted to get some feedback on if this seems possible.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: