Skip to content

Adopt os-log based logging.#2877

Merged
freakboy3742 merged 5 commits into
beeware:mainfrom
freakboy3742:apple-logs
Jun 14, 2026
Merged

Adopt os-log based logging.#2877
freakboy3742 merged 5 commits into
beeware:mainfrom
freakboy3742:apple-logs

Conversation

@freakboy3742

@freakboy3742 freakboy3742 commented Jun 12, 2026

Copy link
Copy Markdown
Member

macOS 26 changed the handling of default logging levels, so running a macOS app through Briefcase under macOS 26 results in the stdout content being displayed as <private>.

To work around this, we need to use an updated version of std-nslog which uses os_log rather than NSLog. However, this requires a binary module, which means the logger can't be loaded until app_packages has been added to the site path. This binary module requires a slightly different predicate pattern to extract log patterns.

However - as of Python 3.14, the functionality of std-nslog is baked into Python by default. As long as you're using 3.14.6+, you can get all of the functionality of std-nslog without importing the package. The predicate pattern here allows for native logging as well, and includes a cookiecutter extension to allow easy evaluation of whether the native shim can be used.

CI "Build app" tasks will fail on macOS until the templates are updated; the landing sequence will be to land the templates, then land this PR. See:

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Comment thread .gitignore Outdated
.specify/templates
.specify/extensions.yml
.specify/extensions
.specify/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean all the other .specify entries can be removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened here - the entry should be ./specify/feature.json. I've pushed an update.

@freakboy3742

Copy link
Copy Markdown
Member Author

@mhsmith I'm going to merge this without a finalised review, because landing the iOS template means the current mainline Briefcase isn't able to view iOS logs, which is breaking Toga's CI (which will, in turn, cause problems with dependabot tomorrow). If you've got any deeper review comments, I'd still appreciate the review.

@freakboy3742 freakboy3742 merged commit f3c5a05 into beeware:main Jun 14, 2026
60 of 67 checks passed
@freakboy3742 freakboy3742 deleted the apple-logs branch June 14, 2026 22:01
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.

2 participants