Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
rigor789
force-pushed
the
feat/ios-structured-logs
branch
from
October 30, 2026 17:59
2fbe7d3 to
eb97eb3
Compare
rigor789
force-pushed
the
feat/ios-structured-logs
branch
from
October 30, 2026 19:29
eb97eb3 to
32d6c68
Compare
rigor789
force-pushed
the
feat/ios-structured-logs
branch
from
October 30, 2026 19:50
32d6c68 to
bfef406
Compare
rigor789
force-pushed
the
feat/ios-structured-logs
branch
from
October 30, 2026 22:15
bfef406 to
8783785
Compare
edusperoni
force-pushed
the
feat/ios-structured-logs
branch
from
November 8, 2026 19:39
5461769 to
e9a3bd7
Compare
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.
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
force-pushed
the
feat/ios-structured-logs
branch
from
November 8, 2026 19:58
e9a3bd7 to
071afe8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Draft until
ios-device-libis 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 aswlan0: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 byos_logwith<…>.What is the new behavior?
os_trace_relayand simulators uselog stream --style ndjson, both selected by executable name, so logs survive closing and reopening the app with no pid tracking.--logsets the scope:debug: the whole app process without debug entries, like Xcodetrace/all: everything"logFormat": 1to the app'spackage.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.lib/common/mobile/ios/ios-log-filter.tsis 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:--log debugand--log trace, before stacking--log traceis large: about 11,000–13,000 extra lines per run of the demo app.logFormat: all unit tests pass, including new ones for lost pieces, interleaved messages and whitespace. On a simulator, capturedlog streamoutput 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.Part of a stack
Base: #6178. Needs NativeScript/ios-device-lib#88 released, and NativeScript/ios#530 for stitching.