-
-
Notifications
You must be signed in to change notification settings - Fork 369
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 iOS log filter for messages coming from extension modules. #842
Conversation
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.
I'm not set up to test iOS yet, so just a couple of comments from reviewing the code:
src/briefcase/platforms/iOS/xcode.py
Outdated
@@ -351,6 +351,15 @@ def run_app(self, app: BaseConfig, udid=None, **kwargs): | |||
) from e | |||
|
|||
# Start log stream for the app. | |||
# The following sets up a log stream filter that looks for: | |||
# 1. a log sender that matches that app binary; or, | |||
# 2. a log sender of that is a Python exception module, |
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.
Should this be "extension module"?
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.
... No, I've invented a whole new type of module. It gets around all that tedious code writing and just raises the inevitable exception for you :-)
(oops - fixed :-)
f'senderImagePath ENDSWITH "/{app.formal_name}"', | ||
f'senderImagePath ENDSWITH "/{app.formal_name}"' | ||
f' OR (processImagePath ENDSWITH "/{app.formal_name}"' | ||
' AND senderImagePath ENDSWITH "-iphonesimulator.so")', |
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.
Why not just include all messages where processImagePath ENDSWITH "/{app.formal_name}"
? Is it because it would be too noisy? If so, it would be worth explaining that in a comment.
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.
The process will generate lots of messages that aren't user-originated (all the usual noise generated by the device notifying system-level events). We only care about the messages that come from the user's code (the sender).
We could almost get away with just filtering on the senderImagePath
. This would work on the simulator, and on any phone that only had 1 Python app running; but if you had a second app generating log messages, those would end up being interspersed with with the app you were trying to log.
Regardless - I'll add a note about this.
Codecov Report
|
When the ctypes module is dynamically loaded, the source of log messages written to NSLog by Python is reported as the extension module, rather than the name of the app binary.
This mirrors the filter that is required for macOS apps, where libFFI is dynamically linked; on macOS, libffi is the source of NSLog messages.
PR Checklist: