8000 tvos: send log messages to NSLog, as on iOS by benface · Pull Request #686 · not-fl3/miniquad · GitHub
[go: up one dir, main page]

Skip to content

tvos: send log messages to NSLog, as on iOS - #686

Open
benface wants to merge 1 commit into
not-fl3:masterfrom
benface:tvos-nslog
Open

benface wants to merge 1 commit into
not-fl3:masterfrom
benface:tvos-nslog

Conversation

@benface
@benface benface commented Oct 10, 2026
Copy link
Copy Markdown
Contributor

Why

__private_api_log_lit sends messages to NSLog only under #[cfg(target_os = "ios")]. tvOS falls through to the desktop version, which prints with eprintln!. An app on an Apple TV has no terminal, so its standard error only shows with Xcode's debugger attached: warn!, error! and the other log-impl macros never reach the system log that Console and log stream read.

The rest of the iOS code that tvOS shares since #651 is already gated on any(target_os = "ios", target_os = "tvos"), and native::ios::log builds for tvOS.

Change

The desktop __private_api_log_lit leaves tvOS out, and the iOS one takes it.

Verification

  • On the tvOS Simulator (tvOS 27.0), a macroquad game (CHOMP) logs a warn! at launch when its save doesn't parse. Before this change, xcrun simctl spawn <device> log stream --predicate 'process == "chomp-tv"' showed nothing from it. With it, the warning shows there.
  • cargo check --features log-impl passes for aarch64-apple-tvos, aarch64-apple-tvos-sim, aarch64-apple-ios and aarch64-apple-darwin.

Related

🤖 Generated with Claude Code

`__private_api_log_lit` sent messages to `NSLog` only for
`target_os = "ios"`. tvOS fell through to the desktop path, which
prints with `eprintln!`, and an app on an Apple TV has no terminal: its
standard error only shows with Xcode's debugger attached. So `warn!`,
`error!` and the other `log-impl` macros never reached the system log,
where Console and `log stream` read it.

tvOS now takes the iOS path, like the rest of the iOS code it already
shares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant

0