Closed ThunderFD closed 9 months ago
Ad 1. Yes, log level is per accessory, but newly paired accessories inherit the level from the gateway.
Ad 2. See https://github.com/ebaauw/homebridge-lib/wiki/Log-Messages. Even with level 0, you’ll still see the warnings and errors.
Thanks for your reply!
Ad 1. Yes, log level is per accessory, but newly paired accessories inherit the level from the gateway.
I see, then I'll have to write a little script that changes the log level for all of them. (that could be a neat future feature to have a built in command for that) But good to see that newly added accessories will inherit the log level from the gateway 👍
Ad 2. See https://github.com/ebaauw/homebridge-lib/wiki/Log-Messages. Even with level 0, you’ll still see the warnings and errors.
Perfect, thanks for the link!
closing this issue 🙏
for anyone stumbling over this, here's a short python3 script to change the logLevel for all accessories and the gateway to 0
import os
import json
# the command to get a dictionary of all the accessories
accessories_command = "ui get /accessories"
# run the command and get the output
accessories = os.popen(accessories_command).read()
# create a list of the keys
accessory_ids = list(json.loads(accessories).keys())
# what to change for each accessory and the gateway
payload = {"logLevel": 0}
# set the change for each accessory
for accessory_id in accessory_ids:
os.system(f"ui put /accessories/{accessory_id} '{json.dumps(payload)}'")
# set the change for the gateway
os.system(f"ui put / '{json.dumps(payload)}'")
Or, using bash
:
for i in $(ui get -al /accessories | grep /name | cut -d / -f 2) ; do
ui put /accessories/$i '{"logLevel": 0}'
done
I'm doing the first steps of migrating from homebridge hue and have 2 questions about logging (as I wanted to reduce clutter in my homebridge logs)
thanks for any answers!