GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(ios): structured app logs that follow relaunches by rigor789 · Pull Request #6179 · NativeScript/nativescript-cli

Conversation

@rigor789

@rigor789 rigor789 commented Oct 30, 2026 •
edited by edusperoni
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Draft until ios-device-lib is released. CI can't compile this against 0.9.6, because the types for the new stream are missing. After NativeScript/ios-device-lib#88 ships, bump the dependency here and mark this ready.

What is the current behavior?

App logs on devices come from syslog_relay, filtered with fragile regexes. Kernel noise such as wlan0: lines gets through, non-ASCII text is escaped, and there is no way to choose how much native output to show. Long messages are truncated by os_log with <…>.

What is the new behavior?

  • Devices stream os_trace_relay and simulators use log stream --style ndjson, both selected by executable name, so logs survive closing and reopening the app with no pid tracking.
  • --log sets the scope:
    • default: JS output
    • debug: the whole app process without debug entries, like Xcode
    • trace / all: everything
  • Debug builds write "logFormat": 1 to the app's package.json. The runtime then logs each piece of a split message as [ns <id> <index>/<count>] <piece>, and the CLI puts the pieces back together by process and message id. A message prints as soon as its last piece arrives; after 500 ms, missing pieces show as <…lost…>, and the next message is never joined onto an unfinished one. Webpack doesn't touch that file and the key only re-signs, so build caching isn't affected.
  • Devices fall back to the syslog relay, with the piece headers removed, if the stream isn't available. Pieces aren't put back together there.
  • The unused lib/common/mobile/ios/ios-log-filter.ts is deleted.

print() and stderr capture follow in #6181.

Testing

Run on the first version of this PR, which used invisible chunk markers. Demo app, 11 messages (up to 100 KB, emoji, 800 lines, console.error, objects) compared exactly against the expected text, on both launches of each run. The full four-PR stack with the runtime PRs:

Setup Simulator (iOS 26.2) iPad (iPadOS 26.7)
Default 11/11 11/11
--log debug and --log trace, before stacking 11/11 11/11
This CLI with stock runtime 9.1.0, before stacking no headers, long messages still truncated as today not run
  • Release prepare leaves the key out and debug prepare includes it.
  • Trailing whitespace at the end of a message is trimmed, as it already was.
  • The syslog fallback has only been tested on captured logs, not in a live app.
  • --log trace is large: about 11,000–13,000 extra lines per run of the demo app.
  • After the switch to logFormat: all unit tests pass, including new ones for lost pieces, interleaved messages and whitespace. On a simulator, captured log stream output from the main thread, two workers and stdout logging at once was rebuilt exactly by this code; see feat(console): split long messages for os_log and report errors as errors ios#530 for the numbers. Not rerun on the iPad.
  • Pieces can still be lost under extreme bursts; see feat(console): split long messages for os_log and report errors as errors ios#530.

Part of a stack

Base: #6178. Needs NativeScript/ios-device-lib#88 released, and NativeScript/ios#530 for stitching.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rigor789 rigor789 mentioned this pull request Oct 30, 2026
feat: stream structured logs from com.apple.os_trace_relay NativeScript/ios-device-lib#88
Open
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 30, 2026
feat(console): split long messages for os_log and report errors as errors NativeScript/ios#530
Open
fix(ios): launch the app once when restarting it on a device #6176
Merged
feat(ios): share DerivedData with Xcode and speed up incremental builds #6178
Open
@rigor789
rigor789 added this pull request to stack #6180 October 30, 2026 17:32
@rigor789
rigor789 force-pushed the feat/ios-structured-logs branch from 2fbe7d3 to eb97eb3 Compare October 30, 2026 17:59
@rigor789 rigor789 mentioned this pull request Oct 30, 2026
feat(ios): show the app's forwarded stdout and stderr #6181
Draft
@rigor789
rigor789 force-pushed the feat/ios-structured-logs branch from eb97eb3 to 32d6c68 Compare October 30, 2026 19:29
@rigor789
rigor789 force-pushed the feat/ios-structured-logs branch from 32d6c68 to bfef406 Compare October 30, 2026 19:50
@rigor789
rigor789 force-pushed the feat/ios-structured-logs branch from bfef406 to 8783785 Compare October 30, 2026 22:15
@edusperoni
edusperoni force-pushed the feat/ios-structured-logs branch from 5461769 to e9a3bd7 Compare November 8, 2026 19:39
rigor789 and others added 2 commits November 8, 2026 16:58
@rigor789 @edusperoni
feat(ios): structured app logs that follow relaunches
35f0e4e
Devices stream com.apple.os_trace_relay and simulators use log stream, both selected by executable name, so logs survive closing and reopening the app. --log picks the scope: JS output by default, the app's native logs without debug entries with debug, everything with trace or all. Without a new enough ios-device-lib, devices fall back to the syslog relay.

Debug builds ask the runtime for chunk markers through logChunkMarkers in the app's package.json, and the CLI stitches split messages back together per process and thread.
@edusperoni
feat(ios): reassemble split app logs from the runtime's piece headers
071afe8
Asks the runtime for log format 1 through the logFormat key of the app's
package.json, in place of logChunkMarkers.

In format 1, each piece of a message the runtime had to split is logged as
"[ns <id> <index>/<count>] <piece>", where the pieces are consecutive
slices of the message. The stitcher now collects pieces by process and
message id, prints the message as soon as its last piece arrives, and
after 500 ms prints what it has with "<…lost…>" where pieces never
arrived. A message can no longer be joined onto another one whose last
piece os_log dropped.

Pieces are joined before the entry is turned into text, so the repeated
console prefix no longer has to be stripped. The syslog fallback, which
doesn't reassemble, removes the headers and shows the pieces as lines.
@edusperoni
edusperoni force-pushed the feat/ios-structured-logs branch from e9a3bd7 to 071afe8 Compare November 8, 2026 19:58

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@rigor789 @edusperoni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.