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

[fix]: short circuit worker logging & require explicit opt-in #285

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

jamieQ
Copy link
Contributor

@jamieQ jamieQ commented Jun 18, 2024

Issue

the existing os logging implementations log various type descriptions as part of the log message. these strings are apparently calculated even if the logging has been disabled, which introduces unneeded/undesirable work in release builds. these logs shouldn't be made in release builds, and should be opt-in in other contexts.

Description

this change adds short circuiting logic for all the os logging methods in addition to a new environment variable check that can be used to enable the logging when debugging.

  • TODO: WorkflowLogger should probably get the same treatment

Checklist

  • Unit Tests – didn't add unit tests, but manually ran existing ones using the new env variable to confirm expected behavior (os_log calls aren't made when the env var isn't set)
    - [x] UI Tests n/a
    - [x] Snapshot Tests (iOS only) n/a
    - [x] I have made corresponding changes to the documentation n/a

@jamieQ jamieQ force-pushed the jquadri/worker-logging-short-circuit branch 2 times, most recently from 432eb43 to 5269d7a Compare June 20, 2024 20:46
@jamieQ jamieQ force-pushed the jquadri/worker-logging-short-circuit branch from 5269d7a to 4f34983 Compare June 20, 2024 21:01
@jamieQ jamieQ marked this pull request as ready for review June 20, 2024 21:33
@jamieQ jamieQ requested a review from a team as a code owner June 20, 2024 21:33
@natecraft1
Copy link

Thanks for jumping on this! I made this ticket https://block.atlassian.net/browse/MPR-2752 so MPR can start to track the hangs that are being addressed

@jamieQ jamieQ enabled auto-merge (squash) June 21, 2024 15:37
@jamieQ jamieQ merged commit a8494ce into main Jun 21, 2024
13 checks passed
@jamieQ jamieQ deleted the jquadri/worker-logging-short-circuit branch June 21, 2024 20:25
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

Successfully merging this pull request may close these issues.

4 participants