Hyper: Getting log messages from Electron

Created on 23 Jul 2016  路  15Comments  路  Source: vercel/hyper

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

help wanted Feature Request

Most helpful comment

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

All 15 comments

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

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

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?

@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.

@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.

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

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

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

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?

I like @OlivierBoucher's approach

We definitely need this!

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.

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)

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eoinmurray picture eoinmurray  路  3Comments

cilice picture cilice  路  3Comments

ghost picture ghost  路  3Comments

juicygoose picture juicygoose  路  3Comments

aem picture aem  路  3Comments