Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log artifacts no longer have stdout/stderr of the launched app #1867

Closed
1 task done
noomorph opened this issue Jan 21, 2020 · 2 comments
Closed
1 task done

Log artifacts no longer have stdout/stderr of the launched app #1867

noomorph opened this issue Jan 21, 2020 · 2 comments

Comments

@noomorph
Copy link
Collaborator

noomorph commented Jan 21, 2020

Description

The logs produced with the current iOS logs implementation have no stdout/stderr of the simulator, hence critical information is missed (e.g. console.log() contents in React Native applications when debugging).

  • I have tested this issue on the latest Detox release and it still reproduces

Reproduction

  1. Add console.error("THIS_MESSAGE_SHOULD_APPEAR") to SanityScreen.js inside Detox test app.
  2. Build the release version with npm run build:os.
  3. Run detox test -c ios.sim.release --record-logs all.
  4. Examine the process.log. There won't be THIS_MESSAGE_SHOULD_APPEAR in the process.log.

This issue is a regression caused by f7d08f5 (PR #1428)

Expected behavior

I should be able to see console.log messages inside device logs taken with --record-logs.

Screenshots

This message will be missing in artifacts/ios.sim.release */Sanity */process.log:

Screen Shot 2020-01-21 at 1 27 02 PM

Environment (please complete the following information):

  • Detox: 15.1.3
  • React Native: 0.60.5
  • Node: 12.10.0
  • Device: iPhone 11 Pro
  • Xcode: 11.2.1
  • iOS: 13.2.2
  • macOS: 10.14.6
@noomorph noomorph self-assigned this Jan 21, 2020
@LeoNatan LeoNatan changed the title [ios] Log artifacts no longer have stdout/stderr of the launched app Log artifacts no longer have stdout/stderr of the launched app Jan 25, 2020
@LeoNatan
Copy link
Contributor

The issue is in the RN logger behavior. Instead of using modern logging facilities, they are using fprintf directly to stderr, which isn't caught by the system logging system. Not sure what the proposed solution should be? We cannot stop collecting the system log, we cannot revert to the old system. We could swizzle somehow the RN logger, but that sounds very error prone, especially if user provides their own logging methods.

I think the only viable solution to this is to open an issue in RN, which I've done: facebook/react-native#27863

@LeoNatan
Copy link
Contributor

Solved in RN master. So this will sort itself with time. For now, there is a solution internally.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants