-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add ability to redirect CHIP logs to a callback and add python log callback integration #5024
Add ability to redirect CHIP logs to a callback and add python log callback integration #5024
Conversation
Size increase report for "esp32-example-build" from 5ca7308
Full report output
|
Can this be rebased on master? The history is pretty hard to look at with all of the commits from #4960. |
The best I could do would be to squash all commits. Master does squash merges today so I cannot properly rebase it (or at least I tried and failed). |
I meant rebase and squash locally, and then force-push. This is fine though as long as whomever merges uses the squash option. |
Size increase report for "gn_qpg6100-example-build" from 8a6335b
Full report output
|
Size increase report for "nrfconnect-example-build" from 8a6335b
Full report output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There is missing synchronization between replacing and accessing callbacks.
- How does this work with the Python GIL ?
Python sets the callbacks at startup, before the CHIP threads are initialized or have a chance to log anything. Did not have trouble here with GIL while running iPython - logs do show up while in the editor. |
556040f
to
d153b30
Compare
Added synchronization via std::atomic |
Since project-chip#5024 there is a new logging callback working. The old code has partially been removed in project-chip#4690, but never completely. Drop the old logging code for good.
Since project-chip#5024 there is a new logging callback working. The old code has partially been removed in project-chip#4690, but never completely. Drop the old logging code for good.
Since project-chip#5024 there is a new logging callback working. The old code has partially been removed in project-chip#4690, but never completely. Drop the old logging code for good.
Problem
Python scripting cannot easily capture logs (and generally log redirects do not seem possible)
Summary of Changes
Add the ability to redirect CHIP Logging to a callback, implement such a log redirect in python.