Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is node_logger operating as expected #1080

Open
bkoblenz opened this issue Feb 19, 2025 · 1 comment
Open

Is node_logger operating as expected #1080

bkoblenz opened this issue Feb 19, 2025 · 1 comment

Comments

@bkoblenz
Copy link

Looking through my logs, I was wishing that the nodeid was included in a number of messages so I started looking at the python-matter-server code.

I found there is a get_node_logger() method which returns a LoggerAdapter passing the nodeid and it looks like there is already the capability in place to do exactly what I want.

But, when I look at my log (for example):
2025-02-17 16:23:38,761 - matter_server.server.device_controller - INFO - No new update found.

This entry uses the node_logger but I do not see the nodeid printed out.

Looking a little deeper there is matter_server/server/main.py which is a way to initiate the server (not what I am using) and it has a parameter --log-node-ids which allows one to specify a set of nodeids that get the extra output, though there does not appear to be support for a wildcard of all nodeids. There is a call to _setup_logger() which seems to handle all the extra nodeid filtering.

Do I really need to replicate all of that in order get nodeids printed in my log? Or is there another way to get them included in my log?
Is it really that important to have this complexity for 10 characters of data? Or am I going about this the wrong way?

From my POV, I would prefer nodeids always be printed on all log lines that are node specific.

@marcelveldt
Copy link
Contributor

The problem is that the node id is not exposed by the SDK in a convenient way. Its on the radar to make this better/easier but there is a ton of refactoring needed on the python bindings on top of the SDK, we might as well just swap out the raw server component with matter.js now that is really maturing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants