i8beef / HomeAutio.Mqtt.GoogleHome

MIT License
215 stars 29 forks source link

Debug logging for google request and response #102

Closed glsf91 closed 3 years ago

glsf91 commented 3 years ago

If something is not working it will be helpfull to log the complete request and complete response from the incoming google requests (Intents). With this logging I hopefully can determine what I did wrong. This makes it also easier to see mistakes in de value mapping. You also get a better understanding of the Google trait documentation (because you can see what is really coming and going from/to Google).

(I did this locally in the GoogleHomeController.cs)

i8beef commented 3 years ago

Coming in a future version. I actually have the changes made to auto spit the incoming request body / response in logs (you just have to enable Trace as minimum level), I just need to get it into a releas.

i8beef commented 3 years ago

Just released a new version that should allow this. If you set the log level in the config file now to "Verbose" you will get a lot of new logs, and among them will be ones formatted like:

Http Request Body: {...}
Http Response: {...}

I do not recommend leaving it in verbose mode outside of testing, as its going to be a lot of logs. You will need to restart the app to get the config changes.

glsf91 commented 3 years ago

Thanks. Maybe add this also to the configuration page (using Verbose). It is working fine but a lot of other logging is also visible. It is difficult to find between everything. Debug and Verbose is hardly useful for a user, more for a developer. Would it not be possible to toggle this on and off with the Information level? I think this google request and response can be very useful for an user when having problems with a trait.

i8beef commented 3 years ago

Added. https://github.com/i8beef/HomeAutio.Mqtt.GoogleHome/wiki/Logging

If you have any suggestions for additional docs let me know.

i8beef commented 3 years ago

Closing as fixed.