laurentj / slimerjs

A scriptable browser like PhantomJS, based on Firefox
http://slimerjs.org
Other
3k stars 258 forks source link

Document / organize output streams #420

Open YousefED opened 8 years ago

YousefED commented 8 years ago

Hi,

I'm having some difficulties understanding what happens to errors in different parts of the application (slimer script, firefox, loaded webpage).

If I'm correct all errors are written to stdout (not stderr)?

I want to prevent any output from slimer to go to stdout, unless I explicitly send it there using system or console.log (from the script). I'm able to override the default error handler to not write to stdout, but it seems other data can still be dumped to stdout by slimer.

e.g., warning messages (from firefox?) such as these:

1452418088856   addons.repository       WARN    cacheEnabled: Couldn't get pref: extensions.getAddons.cache.enabled
laurentj commented 8 years ago

How do you output to stderr?

laurentj commented 8 years ago

I'm not sure we can change the output of message generated by Gecko/Firefox. So we can do nothing for messages like the warning message you show.

YousefED commented 8 years ago

Ok. If there's no way to redirect stdout / stderr of firefox to a separate stream, perhaps the best we can do is document what sources can output to which streams.