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

Getting log messages from Electron #376

Closed
olivierboucher opened this issue Jul 23, 2016 · 15 comments
Closed

Getting log messages from Electron #376

olivierboucher opened this issue Jul 23, 2016 · 15 comments
Labels
help wanted Contributions wanted towards the issue 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper

Comments

@olivierboucher
Copy link

Hi, I'm wondering if there is any way to access log messages from methods invoked by Electron.

  • onApp
  • onWindow
  • ...

Is there any config to activate? That would make plugin development much easier.

Thanks

@mattapperson
Copy link

mattapperson commented Jul 25, 2016

Is the issue that there are no logs? or that onApp and friends are not even being called. Seeing how I can't seem to get logs or crash the app from these hooks I am assuming the latter... /cc @rauchg

Edit: I'm using GA 0.6.0

@olivierboucher
Copy link
Author

@mattapperson Honestly I don't know if its even being called.

@rauchg
Copy link
Member

rauchg commented Jul 25, 2016

Which log messages specifically? console.log of plugins?
Would you like to see them proxied to the web inspector? Or would you like to see them in Console.app?

@rauchg
Copy link
Member

rauchg commented Jul 25, 2016

@olivierboucher I understand your frustration. In the mean time until we've figured out how to surface them properly you could try opening a Node.js write stream to a file and write there.

@olivierboucher
Copy link
Author

olivierboucher commented Jul 26, 2016

@rauchg I think they could be sent over RPC and intercepted/echoed to the web console? What do you think?

EDIT: Yes, console.log messages.

@rauchg
Copy link
Member

rauchg commented Jul 26, 2016

That'd be really sweet. I wonder what the most elegant way of doing this is? Monkey-patching process.stdout.write :P ?

@olivierboucher
Copy link
Author

olivierboucher commented Jul 26, 2016

https://github.com/sfarthin/intercept-stdout/blob/master/intercept-stdout.js
LGTM, the only thing would be to get rid of underscore

@timothyis timothyis added the ❔ Type: Question Issue is a question relating to Hyper (please use zeit.chat or https://spectrum.chat/hyper for this) label Jul 26, 2016
@olivierboucher
Copy link
Author

Do you guys want me to submit a pull request? Could probably do that over the weekend

@saadq
Copy link

saadq commented Oct 17, 2016

Would also like to see console.log messages from plugins show in the web inspector, I believe it's like that in Atom. Are you guys interested in @olivierboucher's proposed solution?

@rauchg
Copy link
Member

rauchg commented Oct 17, 2016

I like @olivierboucher's approach

@chabou
Copy link
Contributor

chabou commented Apr 18, 2017

We definitely need this!

@chabou chabou added 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper and removed ❔ Type: Question Issue is a question relating to Hyper (please use zeit.chat or https://spectrum.chat/hyper for this) labels Apr 18, 2017
@zaynv
Copy link

zaynv commented Aug 7, 2017

Is this issue basically about getting console.log messages to show up in the dev tools when writing a plugin and such? That's what I've been trying to do, but I'm curious as to what everyone else has been doing in the mean time when writing their plugins? I have no idea what's going on because console.log doesn't seem to do anything currently.

@lucat1
Copy link

lucat1 commented Aug 7, 2017

You can clone the repo from master and set it up. Then once you lauch it you should see your logs in the terminal where the electron process is living(so the terminal where your run yarn run app)

@chabou chabou added the help wanted Contributions wanted towards the issue label Aug 14, 2017
@YoungElPaso
Copy link

@zaynv for the plugin hyper-startup at least, they are doing this:

// debugging purposes
// function log(str) {
// 	fs.appendFile(`${__dirname}/log.txt`, str + '\n');
// }

@chabou
Copy link
Contributor

chabou commented Apr 16, 2018

in v2 you can launch hyper in verbose mode to have these logs: hyper --verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions wanted towards the issue 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper
Projects
None yet
Development

No branches or pull requests

9 participants