palazzem / econnect-python

API adapter used to control programmatically an Elmo alarm system
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

feat(client): add DEBUG logging to `ElmoClient` #99

Closed palazzem closed 1 year ago

palazzem commented 1 year ago

Related Issues

Proposed Changes:

This change includes logging DEBUG for all ElmoClient commands. AlarmDevice logs only raised errors as it is a simple proxy to the underlying client. What is logged in ElmoClient can be used in tests to fix any troubles in AlarmDevice. If such statement is proved to not be right, then we'll adjust with further changes.

To enable DEBUG logging in Home Assistant, add this to your configuration.yaml:

logger:
  default: info
  logs:
    custom_components.econnect_alarm: debug
    elmo.api.client: debug

Remember debug logging is pretty verbose, so you must not keep it on for a long time, otherwise it may consume your storage.

Testing:

This PR includes a logger test to verify that SessionID is logged but sanitized. Such test must not be removed otherwise sessions will be leaked in users' logs.

Extra Notes (optional):

n/a

Checklist