question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: console log to native console

See original GitHub issue

Feature Request

Send console.log lines to the native logging system on iOS.

Describe the Feature Request

I’d love to see my console.log lines from my iOS app show up in the macOS console when I have my iPhone connected to my Mac.

I can currently see them in XCode, but I’m talking about running the real app on my phone, connecting it to my Mac, and viewing the logs using the macOS console.app.

Platform Support Requested

  • Android
  • iOS
  • Electron
  • Web

Describe Preferred Solution

I’m not very experienced with iOS development, so I’d defer to whatever solution is provided. Just want to get access to the logs to see what’s going on with my app, since there are things that can’t be tested in the simulator alone.

Describe Alternatives

Related Code

Additional Context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gugahoicommented, May 26, 2021

Adding this would very much improve debuggability of a Capacitor app. Use case we currently have:

  • we have deep links implemented but we observe that they only work when app is backgrounded
  • on cold starts, we want to know what is happening but can’t get those logs via XCode. This is because XCode auto starts the app and attaches the logger to the running instance. If you close the app (not background it), then you can no longer get the logs in the XCode console.
  • since we need to debug “opening the app from a cold start, through a deep link”, we can’t get the logs through XCode

It’s unfortunate that console.log doesn’t show up in the Console.app and this makes debugging this issue much harder. I would imagine that would be other use cases that require a fresh app start as well.

1reaction
jcesarmobilecommented, Jan 13, 2020

Issues tagged with feature request are closed but tracked for reactions to gauge interest.

This is a really easy to implement, Console plugin should just use NSLog instead of print, but NSLog is slower, so I wouldn’t make this default, should be configurable and keep using print by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Ways to Log an Object to the Console in JavaScript
When developing in a browser, the console.log() method called with an object or objects as arguments will display the object or objects. “The ......
Read more >
logging react native event with console.log not firing and ...
The solution is to use e. nativeEvent rather than e in the console. log line, since the nativeEvent has no circular references.
Read more >
React Native Debugger - Stop Using Console Logs - Tutorial
Chrome Developer Tools - uses a remote debugging feature and offers only basic features such as logging output to console or using the...
Read more >
How do I console.log() inside of a Class? (Example) - Treehouse
So when Guil console logs "this.removePlayer" to show in the console the function passed from "App" to "Player", he does so with the...
Read more >
console.log() - Web APIs - MDN Web Docs
Please be warned that if you log objects in the latest versions of Chrome and Firefox what you get logged on the console...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found