Getting logging to work in custom quirk #2511
-
|
Hi all, I'm trying to get a custom quirk working #2451 but find I'm rather stuck without logging and I can't get logging to show in the I've added logging to the quirk using: import logging
_LOGGER = logging.getLogger(__name__)And I've tried logging with both debug/warn to no results. For example: _LOGGER.debug("WindowCovering command %04x", command_id)
_LOGGER.warn("OnOff update attribute %04x to %s", attrid, value)My current logger config is as follows: logger:
default: warn
logs:
# homeassistant.core: debug
homeassistant.components.zha.cover: debug
# bellows.zigbee.application: debug
# bellows.ezsp: debug
# zigpy: debug
# zigpy_deconz.zigbee.application: debug
# zigpy_deconz.api: debug
# zigpy_xbee.zigbee.application: debug
# zigpy_xbee.api: debug
# zigpy_zigate: debug
# zigpy_znp: debug
zhaquirks: debug
custom_zha_quirks: debugI'd tried all the various commented out options as well. Any advice on how to get logging going would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
"Warning" logs should definitely work. Did you try them in an IIRC, if your quirk file is called |
Beta Was this translation helpful? Give feedback.
-
|
Thank you! I've just done that and can see logs. 🤦 I can also confirm that the logger name was the same as the file name. I guess that means something else is going wrong and it's possible my custom clusters aren't being used correctly. |
Beta Was this translation helpful? Give feedback.
"Warning" logs should definitely work. Did you try them in an
__init__function (something that's definitely called)? (Is the quirk picked up properly for the device? (can be seen on device page)IIRC, if your quirk file is called
test.py, it should be enough to settest: debugto switch that custom quirk logger to debug.If it's in a folder, it should be
folder.file: debug.