-
Notifications
You must be signed in to change notification settings - Fork 2.2k
ChipLog* no longer logs to stdout/stderr in darwin-framework-tool #24194
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
Labels
Comments
bzbarsky-apple
added a commit
to bzbarsky-apple/connectedhomeip
that referenced
this issue
Dec 22, 2022
darwin-framework-tool ends up linking in two copies of CHIPLogging, so the redirect we were setting up was only capturing ChipLog* calls that happened inside Matter.framework. The calls from darwin-framework-tool itself were getting dropped after being logged via os_log, and not showing up on stdout. Also includes a drive-by fix to stop building address-resolve-tool every time we build darwin-framework-tool. Fixes project-chip#24194
bzbarsky-apple
added a commit
that referenced
this issue
Jan 3, 2023
…4195) darwin-framework-tool ends up linking in two copies of CHIPLogging, so the redirect we were setting up was only capturing ChipLog* calls that happened inside Matter.framework. The calls from darwin-framework-tool itself were getting dropped after being logged via os_log, and not showing up on stdout. Also includes a drive-by fix to stop building address-resolve-tool every time we build darwin-framework-tool. Fixes #24194
kkasperczyk-no
pushed a commit
to kkasperczyk-no/sdk-connectedhomeip
that referenced
this issue
Mar 15, 2023
…4195) darwin-framework-tool ends up linking in two copies of CHIPLogging, so the redirect we were setting up was only capturing ChipLog* calls that happened inside Matter.framework. The calls from darwin-framework-tool itself were getting dropped after being logged via os_log, and not showing up on stdout. Also includes a drive-by fix to stop building address-resolve-tool every time we build darwin-framework-tool. Fixes project-chip/connectedhomeip#24194
kkasperczyk-no
pushed a commit
to kkasperczyk-no/sdk-connectedhomeip
that referenced
this issue
Mar 15, 2023
…4195) darwin-framework-tool ends up linking in two copies of CHIPLogging, so the redirect we were setting up was only capturing ChipLog* calls that happened inside Matter.framework. The calls from darwin-framework-tool itself were getting dropped after being logged via os_log, and not showing up on stdout. Also includes a drive-by fix to stop building address-resolve-tool every time we build darwin-framework-tool. Fixes project-chip/connectedhomeip#24194
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is fallout from PR #23528.
Before that change, running something like
darwin-framework-tool tests TestCluster
will show these log bits:before it stops progress due to trying to find the server to send the server to send the command to and failing. After that change, those messages are not logged.
The problem, as far as I can tell, is that darwin-framework-tool links two copies of CHIPLogging.cpp: one as part of Matter.framework and one directly in the executable.
Which means there are two copies of
sLogRedirectCallback
. darwin-framework-tool sets up (indirectly, via calling MTRSetLogCallback on the framework) a log redirect that logs to stdout.Now if we have a
ChipLog*
call from inside the SDK/framework it ends up inchip::Logging::Logv
, it will find the framework copy ofsLogRedirectCallback
, that's not null, it will get called, and the output will appear on stdout.But if we hav a
ChipLog*
call from directly inside darwin-framework-tool (e.g. the generated test code that logs the things above), then it will find the other copy ofsLogRedirectCallback
, which is null. It will then callPlatform::LogV
, which is a no-op on Darwin, and the log gets lost.The text was updated successfully, but these errors were encountered: