Skip to content

Conversation

@dkimitsa
Copy link
Contributor

also fixes #826 iOS 26.1 no log output in console

os/log uses macro that wrap implementation API and it can't be bound directly. instead wrapper with clear api to be used (RvmOSLog). CocoaTouch bindings hadn't native component before and it was introduced with this PR. It contains simple rvm_oslog.m now. objc class RvmOSLog was used instead of function wrapper as RoboVM doesn't support -force_load linkage with static xcframework that causes symbols not being linked and not available runtime.

usage:

  1. directly

OSLog.log("Hello Default Log");

  1. redirect all stdout/err to it:
        System.setOut(new OSLogPrintStream(OSLog.create("robovm", "stdout"), OSLog.Type.DEFAULT));
        System.setErr(new OSLogPrintStream(OSLog.create("robovm", "stderr"), OSLog.Type.ERROR));
        System.out.println("Hello STDOUT");
        System.err.println("Hello STDERR");

IMPORTANT: os_log prints are not STDOUT prints and not available in tty/console.
these can be accessed using Console application, Xcode or log command line tool. E.g.

log stream
log stream --predicate 'subsystem == "robovm"'

also fixes MobiVM#826 iOS 26.1 no log output in console

os/log uses macro that wrap implementation API and it can't be bound directly.
instead wrapper with clear api to be used (RvmOSLog).
CocoaTouch bindings hadn't native component before and it was introduced with this PR. It contains simple rvm_oslog.m now.
objc class `RvmOSLog` was used instead of function wrapper as RoboVM doesn't support -force_load linkage with static xcframework that causes symbols not being linked and not available runtime.
@dkimitsa dkimitsa added this to the 2.3.25 milestone Nov 11, 2025
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.

iOS 26.1 no log output in console

1 participant