I have scripts running to activate lights, but I cannot seem to get the logging working. It seems the built-in variable ‘logger’ is not available. The ‘has’ variable is available though.
When I add a file with just on line to log a message to the pyscript folder I receive the error below.
Script:
logger.error('Test')
Error:
2023-01-26 00:08:19.615 ERROR (MainThread) [custom_components.pyscript.file.test_logger] Exception in </config/pyscript/test_logger.py> line 1:
logger.error('Test')
^
NameError: name 'logger.error' is not defined
Does anyone have any idea how to troubleshoot this?
I am running:
Home Assistant 2023.1.7
Supervisor 2022.12.1
Operating System 9.4
Frontend 20230110.0 - latest
Pyscript 1.3.3