rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.91k stars 557 forks source link

Add contextual logging to platforms #95

Closed postlund closed 3 years ago

postlund commented 4 years ago

Recently I added contextual logging in pytuya, so all log points contains the device id. This helps a lot when debugging as it's really hard to decode which log points comes from which device (due to the async network of communication). We should do the same in LocalTuyaEntity, so all subclasses can use for instance self.log to log with contextual output. We can start by adding device id here as well.

postlund commented 4 years ago

More of a comment to myself: this issue is becoming more and more important as we get more issue reports. The logs are hard to interpret when context is missing, so this should have high priority. Since we do have a few outstanding issues, I feel that it's good to wait until most of them are merged to avoid unnecessary conflicts.