You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Raymond Camden <ra...@gmail.com> on 2015/03/26 23:10:34 UTC

hook logging issue

This may stray into the "it should be on the google group" territory,
if so, just let me know.

I'm rewriting Holly's after_platform_add hook to use module.exports.
When I do, I notice console.log no longer works. Is that expected -
and if so - is there a workaround? (To be clear, the hook still works
perfectly well as far as I can see, I just don't see console output.)

module.exports = function(context) {

console.log("Testing "+context);
var pluginlist = [
   "org.apache.cordova.device",
   "org.apache.cordova.device-motion",
   "org.apache.cordova.device-orientation",
   "org.apache.cordova.geolocation"
];

// no need to configure below
var fs = require('fs');
var path = require('path');
var sys = require('sys')
var exec = require('child_process').exec;

function puts(error, stdout, stderr) {
//console.log(stdout);
}

pluginlist.forEach(function(plug) {
exec("cordova plugin add " + plug, puts);
});


}

-- 
===========================================================================
Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com
Blog : www.raymondcamden.com
Twitter: raymondcamden

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: hook logging issue

Posted by Raymond Camden <ra...@gmail.com>.
https://issues.apache.org/jira/browse/CB-8763

On Thu, Mar 26, 2015 at 9:30 PM, Shazron <sh...@gmail.com> wrote:
> File it pls thx! No idea of the workaround
>
> On Thursday, March 26, 2015, Raymond Camden <ra...@gmail.com> wrote:
>
>> So file a bug?
>>
>> Know a way around it?
>>
>> On Thu, Mar 26, 2015 at 5:46 PM, Shazron <shazron@gmail.com <javascript:;>>
>> wrote:
>> > actually it has stdio:inherit, and does capture the output and pushes
>> > it back up the chain, so somewhere up the chain no one does anything
>> > with it
>> >





-- 
===========================================================================
Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com
Blog : www.raymondcamden.com
Twitter: raymondcamden

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: hook logging issue

Posted by Shazron <sh...@gmail.com>.
File it pls thx! No idea of the workaround

On Thursday, March 26, 2015, Raymond Camden <ra...@gmail.com> wrote:

> So file a bug?
>
> Know a way around it?
>
> On Thu, Mar 26, 2015 at 5:46 PM, Shazron <shazron@gmail.com <javascript:;>>
> wrote:
> > actually it has stdio:inherit, and does capture the output and pushes
> > it back up the chain, so somewhere up the chain no one does anything
> > with it
> >
> > On Thu, Mar 26, 2015 at 3:36 PM, Shazron <shazron@gmail.com
> <javascript:;>> wrote:
> >>
> https://github.com/apache/cordova-lib/blob/d77ebc40a16ab27a8ed22c0bbf2ab8a84a5ac448/cordova-lib/src/hooks/HooksRunner.js#L188
> >>
> >> It's using child_process.spawn (if you dig down) and is probably
> >> ignoring all stdio when running the script.
> >>
> >> On Thu, Mar 26, 2015 at 3:10 PM, Raymond Camden <
> raymondcamden@gmail.com <javascript:;>> wrote:
> >>> This may stray into the "it should be on the google group" territory,
> >>> if so, just let me know.
> >>>
> >>> I'm rewriting Holly's after_platform_add hook to use module.exports.
> >>> When I do, I notice console.log no longer works. Is that expected -
> >>> and if so - is there a workaround? (To be clear, the hook still works
> >>> perfectly well as far as I can see, I just don't see console output.)
> >>>
> >>> module.exports = function(context) {
> >>>
> >>> console.log("Testing "+context);
> >>> var pluginlist = [
> >>>    "org.apache.cordova.device",
> >>>    "org.apache.cordova.device-motion",
> >>>    "org.apache.cordova.device-orientation",
> >>>    "org.apache.cordova.geolocation"
> >>> ];
> >>>
> >>> // no need to configure below
> >>> var fs = require('fs');
> >>> var path = require('path');
> >>> var sys = require('sys')
> >>> var exec = require('child_process').exec;
> >>>
> >>> function puts(error, stdout, stderr) {
> >>> //console.log(stdout);
> >>> }
> >>>
> >>> pluginlist.forEach(function(plug) {
> >>> exec("cordova plugin add " + plug, puts);
> >>> });
> >>>
> >>>
> >>> }
> >>>
> >>> --
> >>>
> ===========================================================================
> >>> Raymond Camden, Developer Advocate for MobileFirst at IBM
> >>>
> >>> Email : raymondcamden@gmail.com <javascript:;>
> >>> Blog : www.raymondcamden.com
> >>> Twitter: raymondcamden
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> <javascript:;>
> >>> For additional commands, e-mail: dev-help@cordova.apache.org
> <javascript:;>
> >>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> <javascript:;>
> > For additional commands, e-mail: dev-help@cordova.apache.org
> <javascript:;>
> >
>
>
>
> --
> ===========================================================================
> Raymond Camden, Developer Advocate for MobileFirst at IBM
>
> Email : raymondcamden@gmail.com <javascript:;>
> Blog : www.raymondcamden.com
> Twitter: raymondcamden
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org <javascript:;>
> For additional commands, e-mail: dev-help@cordova.apache.org
> <javascript:;>
>
>

Re: hook logging issue

Posted by Raymond Camden <ra...@gmail.com>.
So file a bug?

Know a way around it?

On Thu, Mar 26, 2015 at 5:46 PM, Shazron <sh...@gmail.com> wrote:
> actually it has stdio:inherit, and does capture the output and pushes
> it back up the chain, so somewhere up the chain no one does anything
> with it
>
> On Thu, Mar 26, 2015 at 3:36 PM, Shazron <sh...@gmail.com> wrote:
>> https://github.com/apache/cordova-lib/blob/d77ebc40a16ab27a8ed22c0bbf2ab8a84a5ac448/cordova-lib/src/hooks/HooksRunner.js#L188
>>
>> It's using child_process.spawn (if you dig down) and is probably
>> ignoring all stdio when running the script.
>>
>> On Thu, Mar 26, 2015 at 3:10 PM, Raymond Camden <ra...@gmail.com> wrote:
>>> This may stray into the "it should be on the google group" territory,
>>> if so, just let me know.
>>>
>>> I'm rewriting Holly's after_platform_add hook to use module.exports.
>>> When I do, I notice console.log no longer works. Is that expected -
>>> and if so - is there a workaround? (To be clear, the hook still works
>>> perfectly well as far as I can see, I just don't see console output.)
>>>
>>> module.exports = function(context) {
>>>
>>> console.log("Testing "+context);
>>> var pluginlist = [
>>>    "org.apache.cordova.device",
>>>    "org.apache.cordova.device-motion",
>>>    "org.apache.cordova.device-orientation",
>>>    "org.apache.cordova.geolocation"
>>> ];
>>>
>>> // no need to configure below
>>> var fs = require('fs');
>>> var path = require('path');
>>> var sys = require('sys')
>>> var exec = require('child_process').exec;
>>>
>>> function puts(error, stdout, stderr) {
>>> //console.log(stdout);
>>> }
>>>
>>> pluginlist.forEach(function(plug) {
>>> exec("cordova plugin add " + plug, puts);
>>> });
>>>
>>>
>>> }
>>>
>>> --
>>> ===========================================================================
>>> Raymond Camden, Developer Advocate for MobileFirst at IBM
>>>
>>> Email : raymondcamden@gmail.com
>>> Blog : www.raymondcamden.com
>>> Twitter: raymondcamden
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>



-- 
===========================================================================
Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com
Blog : www.raymondcamden.com
Twitter: raymondcamden

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: hook logging issue

Posted by Shazron <sh...@gmail.com>.
actually it has stdio:inherit, and does capture the output and pushes
it back up the chain, so somewhere up the chain no one does anything
with it

On Thu, Mar 26, 2015 at 3:36 PM, Shazron <sh...@gmail.com> wrote:
> https://github.com/apache/cordova-lib/blob/d77ebc40a16ab27a8ed22c0bbf2ab8a84a5ac448/cordova-lib/src/hooks/HooksRunner.js#L188
>
> It's using child_process.spawn (if you dig down) and is probably
> ignoring all stdio when running the script.
>
> On Thu, Mar 26, 2015 at 3:10 PM, Raymond Camden <ra...@gmail.com> wrote:
>> This may stray into the "it should be on the google group" territory,
>> if so, just let me know.
>>
>> I'm rewriting Holly's after_platform_add hook to use module.exports.
>> When I do, I notice console.log no longer works. Is that expected -
>> and if so - is there a workaround? (To be clear, the hook still works
>> perfectly well as far as I can see, I just don't see console output.)
>>
>> module.exports = function(context) {
>>
>> console.log("Testing "+context);
>> var pluginlist = [
>>    "org.apache.cordova.device",
>>    "org.apache.cordova.device-motion",
>>    "org.apache.cordova.device-orientation",
>>    "org.apache.cordova.geolocation"
>> ];
>>
>> // no need to configure below
>> var fs = require('fs');
>> var path = require('path');
>> var sys = require('sys')
>> var exec = require('child_process').exec;
>>
>> function puts(error, stdout, stderr) {
>> //console.log(stdout);
>> }
>>
>> pluginlist.forEach(function(plug) {
>> exec("cordova plugin add " + plug, puts);
>> });
>>
>>
>> }
>>
>> --
>> ===========================================================================
>> Raymond Camden, Developer Advocate for MobileFirst at IBM
>>
>> Email : raymondcamden@gmail.com
>> Blog : www.raymondcamden.com
>> Twitter: raymondcamden
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: hook logging issue

Posted by Shazron <sh...@gmail.com>.
https://github.com/apache/cordova-lib/blob/d77ebc40a16ab27a8ed22c0bbf2ab8a84a5ac448/cordova-lib/src/hooks/HooksRunner.js#L188

It's using child_process.spawn (if you dig down) and is probably
ignoring all stdio when running the script.

On Thu, Mar 26, 2015 at 3:10 PM, Raymond Camden <ra...@gmail.com> wrote:
> This may stray into the "it should be on the google group" territory,
> if so, just let me know.
>
> I'm rewriting Holly's after_platform_add hook to use module.exports.
> When I do, I notice console.log no longer works. Is that expected -
> and if so - is there a workaround? (To be clear, the hook still works
> perfectly well as far as I can see, I just don't see console output.)
>
> module.exports = function(context) {
>
> console.log("Testing "+context);
> var pluginlist = [
>    "org.apache.cordova.device",
>    "org.apache.cordova.device-motion",
>    "org.apache.cordova.device-orientation",
>    "org.apache.cordova.geolocation"
> ];
>
> // no need to configure below
> var fs = require('fs');
> var path = require('path');
> var sys = require('sys')
> var exec = require('child_process').exec;
>
> function puts(error, stdout, stderr) {
> //console.log(stdout);
> }
>
> pluginlist.forEach(function(plug) {
> exec("cordova plugin add " + plug, puts);
> });
>
>
> }
>
> --
> ===========================================================================
> Raymond Camden, Developer Advocate for MobileFirst at IBM
>
> Email : raymondcamden@gmail.com
> Blog : www.raymondcamden.com
> Twitter: raymondcamden
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org