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-ios' broken, maybe invoke 'log' instead of 'syslog' #21850

Closed
Annihil opened this issue Oct 18, 2018 · 4 comments
Closed

'log-ios' broken, maybe invoke 'log' instead of 'syslog' #21850

Annihil opened this issue Oct 18, 2018 · 4 comments
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@Annihil
Copy link

Annihil commented Oct 18, 2018

Environment

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 3.49 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.10.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
react-native: 0.57.3 => 0.57.3
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

Description

Currently, react-native log-ios seems to be broken, it does not display console.log/warm/error outputs, which is its main purpose...

After digging into the code, log-ios logic, which is located in local-cli/logIOS/logIOS.js, is invoking

syslog -w -F std -d /Users/john/Library/Logs/CoreSimulator/3FEB5B23-BA83-4AC0-A60D-CC07412FE6CC/asl

outputting lines like this

 com.apple.CoreSimulator.SimDevice.3FEB5B23-BA83-4AC0-A60D-CC07412FE6CC[17151] (com.apple.securityuploadd) <Notice>: Service only ran for 5 seconds. Pushing respawn out by 5 seconds.

What works

log stream --predicate '(processImagePath contains "<XCode Project Name") and senderImageUUID == processImageUUID' --style json

(case sensitive)

outputting the same lines (in eventMessage prop) as the XCode debug pane

{
  "traceID" : 13867796580663300,
  "eventMessage" : "Running application \"Foobar\" with appParams: {\"rootTag\":31,\"initialProps\":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF",
  "eventType" : "logEvent",
  "source" : null,
  "formatString" : "%s",
  "activityIdentifier" : 0,
  "subsystem" : "",
  "category" : "",
  "threadID" : 2354892,
  "senderImageUUID" : "5563B3FF-BDAD-33A2-BA67-FB3B6A6BF913",
  "backtrace" : {
    "frames" : [
      {
        "imageOffset" : 979817,
        "imageUUID" : "5563B3FF-BDAD-33A2-BA67-FB3B6A6BF913"
      }
    ]
  },
  "processImagePath" : "\/Users\/john\/Library\/Developer\/CoreSimulator\/Devices\/3FEB5B23-BA83-4AC0-A60D-CC07412FE6CC\/data\/Containers\/Bundle\/Application\/9BC93A5D-BCD6-4C90-9D4C-1E229B8327AB\/Foorbar.app\/Foobar",
  "senderImagePath" : "\/Users\/john\/Library\/Developer\/CoreSimulator\/Devices\/3FEB5B23-BA83-4AC0-A60D-CC07412FE6CC\/data\/Containers\/Bundle\/Application\/9BC93A5D-BCD6-4C90-9D4C-1E229B8327AB\/Foobar.app\/Foobar",
  "timestamp" : "2018-10-18 17:19:50.962092+0100",
  "machTimestamp" : 890073747743698,
  "messageType" : "Default",
  "processImageUUID" : "5563B3FF-BDAD-33A2-BA67-FB3B6A6BF913",
  "processID" : 17313,
  "senderProgramCounter" : 979817,
  "parentActivityIdentifier" : 0,
  "timezoneName" : ""
}

Here is a POC to demonstrate that this approach works: react-native-log-ios

npm install --global react-native-log-ios
react-native-log-ios <XCode Project Name>
17:19:50, Running application "Foobar" with appParams: {"rootTag":31,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@stale
Copy link

stale bot commented Jan 20, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 20, 2019
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 26, 2019
@hramos hramos removed the Bug Report label Feb 6, 2019
@dulmandakh
Copy link
Contributor

Hello there 👋 this issue has been reported for an old version of React Native. Ideally we'd like everyone to be using 0.59 (see the awesome changes it brought) but we know updating can be a pain. We are going to close this issue because it's from a version before 0.57, which is really old.

But please, if it's actually still an issue with 0.59 please comment below and we can reopen it. Even better, please send us a pull request with a fix 😊

@dulmandakh
Copy link
Contributor

In 0.59, we have brand new CLI and it should work great for most cases. And please file an issue https://github.com/react-native-community/react-native-cli if the issue persists.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants