Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can't get logging to work #744

Unanswered
drache42 asked this question in Q&A
Discussion options

I am just getting started with pyscript. I have it running, but logging doesn't seem to work.

in my configuration.yaml I have

logger:
 default: info
 logs:
 custom_components.pyscript: debug

My script file is this

@service
def hello(name: str = "world"):
 log.debug(f"[HELLO] entered hello(name={name!r})")
 light.toggle(entity_id="light.shelly_dimmer_master_sitting_room")
 msg = f"Hello, {name}!"
 log.info(f"[HELLO] {msg}")
 task.sleep(0.1) # example of yielding; keeps HA responsive
 log.debug("[HELLO] leaving hello()")

I can run the script, and it toggles the light. This tells me the script can run and it works.

However, Going to Settings -> System -> Logs and looking at the Home Assistant Core log, I don't see any of my log messages. Logs from other things in my system are there, but nothing from my hello.py script.

Any help would be appreciated.

P.S. I've restarted HASS a few times, so that's not the problem.

You must be logged in to vote

Replies: 1 comment

Comment options

Answered in your issue #745 (comment)

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /