You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: