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

Would be convenient if console.log wrote to Android's LOGCAT #9

Open
jackpal opened this issue Apr 11, 2012 · 4 comments
Open

Would be convenient if console.log wrote to Android's LOGCAT #9

jackpal opened this issue Apr 11, 2012 · 4 comments

Comments

@jackpal
Copy link

jackpal commented Apr 11, 2012

It would be convenient if console.log and related functions wrote to Android's LOGCAT by default.

See android/log.h in the NDK.

@paddybyers
Copy link
Owner

Yes, I've been meaning to do this for a while. Obviously a pull request would be great :)

@jackpal
Copy link
Author

jackpal commented Apr 12, 2012

Hmm, I see the problem is that console writes to stdout, which Android black-holes.

So maybe it would be better to provide a separate android log API, and maybe a wrapper that's compatible with console.

How would you go about implementing such a thing?

One way would be to export the Android NDK log APIs as a new node module.

Another way would be to export the Android Java log APIs as a new node module.

Is either of that supported for anode? Are there any examples of Android APIs being exported?

Or is there another way?

@NomadLibra
Copy link

You can redirect stdio to logcat.

$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start

@jackpal
Copy link
Author

jackpal commented Jul 10, 2012

Thanks!
On Jul 10, 2012 12:04 PM, "NomadLibra" <
[email protected]>
wrote:

You can redirect stdio to logcat.

$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start


Reply to this email directly or view it on GitHub:
#9 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants