custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
874 stars 46 forks source link

Logging Documentation for Apps vs Scripts #520

Open marshalltech81 opened 1 year ago

marshalltech81 commented 1 year ago

In following https://hacs-pyscript.readthedocs.io/en/latest/reference.html#logging, it is not readily apparent that the steps for setting logging on a script by script basis like illustrated here:

logger:
  default: info
  logs:
    custom_components.pyscript.file: info
    custom_components.pyscript.file.my_script.my_function: debug

would change if the script in question is really an app which appears to change these directions to:

logger:
  default: info
  logs:
    custom_components.pyscript.apps: info
    custom_components.pyscript.apps.my_script.my_function: debug

I was able to finally piece this together based on the output of the debugging log when I got this working using logger.set_level(**{"custom_components.pyscript": "debug"}) at the top of my script/app just to see how the debugging log would come through.