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

process.stdout.write does not output to DevTools console? #30

Closed
krohrsb opened this issue Aug 3, 2015 · 26 comments
Closed

process.stdout.write does not output to DevTools console? #30

krohrsb opened this issue Aug 3, 2015 · 26 comments

Comments

@krohrsb
Copy link

krohrsb commented Aug 3, 2015

The app i was testing with uses bunyan which logs to the console. However when running with iron-node the console/stdout is suppressed for some reason.

@s-a
Copy link
Owner

s-a commented Aug 3, 2015

Did you checked the devtools console?

@krohrsb
Copy link
Author

krohrsb commented Aug 3, 2015

a normal console.log in the app does output to the devtools console. However using bunyan with (bunyan-format)[https://github.com/thlorenz/bunyan-format] as the output stream does not. Though of course bunyan normally does log the output.

@s-a
Copy link
Owner

s-a commented Aug 3, 2015

Not very beautiful but I got output to terminal console

image

I have noticed some other things regarding to that as described at electron/electron#2390

@s-a
Copy link
Owner

s-a commented Aug 3, 2015

@BlackBarn do you see any output like on my console? Otherweise I would like to change the issue title.

@s-a
Copy link
Owner

s-a commented Aug 4, 2015

My guess is that the isbrowser method does not work correct within electron environment.

https://github.com/trentm/node-bunyan/blob/master/lib/bunyan.js#L407 can you clarify this?

@s-a s-a closed this as completed Aug 4, 2015
@s-a s-a changed the title No log output? No console.log() output to DevTools console? Aug 4, 2015
@krohrsb
Copy link
Author

krohrsb commented Aug 5, 2015

Sorry, I was preoccupied there for awhile. I'm glad it seems to be working and sorry for causing any problems. When I have time i'll dig into my implementation a bit more to see if I can find my issue. Thanks for all your work on the project!

@s-a
Copy link
Owner

s-a commented Aug 5, 2015

Absolutely no problem, feel free to submit issues! Well I am not shure it isjust a guess. So if you want. Would be nice to keep us up-to-date here.

@Bargs
Copy link

Bargs commented Nov 11, 2015

I'm having the same issue. Logs that are piped to process.stdout do not show up in my terminal or Devtools console. I do successfully get logs when using the regular node process. Any ideas what might be going on?

@s-a
Copy link
Owner

s-a commented Nov 11, 2015

Can you publish a reproducable code example?

@s-a s-a reopened this Nov 11, 2015
@Bargs
Copy link

Bargs commented Nov 11, 2015

If you clone the Kibana repo (https://github.com/elastic/kibana) and run node ./src/cli you'll see some log output. If you run iron-node ./src/cli there will be no log output in the terminal or Devtools console.

Note that these logs are ultimately getting sent to process.stdout in ./src/server/logging/LogReporter.js

@s-a
Copy link
Owner

s-a commented Nov 11, 2015

Ty, I will check this out this weekend .
Am 12.11.2015 00:12 schrieb "Matt Bargar" notifications@github.com:

If you clone the Kibana repo (https://github.com/elastic/kibana) and run node
./src/cli you'll see some log output. If you run iron-node ./src/cli
there will be no log output in the terminal or Devtools console.


Reply to this email directly or view it on GitHub
#30 (comment).

@s-a
Copy link
Owner

s-a commented Nov 14, 2015

Sir @BlackBarn I will not find time this we again :\ pls can u try #60 (comment). there where a lot of improvements by the creators of Electron regarding console log. Hope this will help u. You can try to upgrade electron within iron -node

@Bargs
Copy link

Bargs commented Nov 16, 2015

Hi @s-a , I tried upgrading Electron, unfortunately it didn't make a difference.

@s-a
Copy link
Owner

s-a commented Nov 16, 2015

@Bargs ty for the attempt. Could you please open an issue at the electron repo?

@Bargs
Copy link

Bargs commented Nov 17, 2015

Yes I'll try to get to that this weekend. Thanks!

@s-a
Copy link
Owner

s-a commented Dec 10, 2015

@Bargs I plan a new release this weekend. Any news about this topic?

@Bargs
Copy link

Bargs commented Dec 11, 2015

Hi @s-a. I have to admit this slipped my mind. I haven't been working with iron node much recently, if I get back into it I'll make sure to follow up.

@s-a s-a closed this as completed Dec 12, 2015
@willhoag
Copy link

willhoag commented Jan 2, 2016

Hi! I'm having the same issue. Any updates on this? I'm happy to make an issue on the electron repo, but haven't used electron and wouldn't know how to properly describe what we think is happening.

@s-a
Copy link
Owner

s-a commented Jan 2, 2016

I believe you experience this issue when using console output log streams. I never used this. But it seems you have reproducable code there?

@willhoag
Copy link

willhoag commented Jan 2, 2016

Yeah, when using streams process.stdout like this:

process.stdout.write("doesn't work")
console.log('works')

@s-a
Copy link
Owner

s-a commented Jan 2, 2016

Ok. Could you plz send an issue to the creator s of electron?

@willhoag
Copy link

willhoag commented Jan 5, 2016

Per electron/electron#3979 (comment) to get output in the console via process.stdout.write it sounds like this ought to do it:

process.stdout.write = console.log.bind(console);

Can you confirm?

@s-a
Copy link
Owner

s-a commented Jan 5, 2016

@willhoag thanks for clarify! Yes it sounds very reasonable. You can test if this works when you put this code into your startup script. I will implement the code into iron-node core if this works for you. I would test it but realy never used process.stdout.write.

@s-a s-a reopened this Jan 5, 2016
@s-a s-a changed the title No console.log() output to DevTools console? process.stdout.write does not output to DevTools console? Jan 5, 2016
@s-a
Copy link
Owner

s-a commented Jan 5, 2016

image
just tested this with kibana by @Bargs 👍

Will publish this pice of code with the next release. Ty @willhoag

@s-a s-a closed this as completed in a66b699 Jan 5, 2016
@s-a
Copy link
Owner

s-a commented Jan 5, 2016

Please use https://github.com/s-a/iron-node/releases/tag/v2.1.4 for further testings.

@willhoag
Copy link

willhoag commented Jan 6, 2016

Confirming that the update produces output using process.stdout.write in the console. Thx!

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

No branches or pull requests

4 participants