cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhilkh <...@git.apache.org>
Subject [GitHub] cordova-medic pull request: CB-8936 Windows logs gathering
Date Tue, 18 Aug 2015 16:46:37 GMT
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/59#discussion_r37322269
  
    --- Diff: medic/medic-run.js ---
    @@ -238,6 +241,26 @@ function windowsSpecificPreparation(argv) {
             );
         }
     
    +    // start logging
    +    var logScriptPath = path.join(platformPath, 'cordova', 'log');
    +    if (fs.existsSync(logScriptPath)) {
    +        util.medicLog('Running windows log script')
    +        logProcess = cp.fork(logScriptPath, [], { silent: true });
    +
    +        logProcess.stdout.on('data', function (data) {
    +            fs.appendFileSync('./out.log', data, { encoding: util.DEFAULT_ENCODING });
    +        });
    +        logProcess.stderr.on('data', function (data) {
    +            util.medicLog('Logging script STDERR: ' + data);
    +            fs.appendFileSync('./out.log', data, { encoding: util.DEFAULT_ENCODING });
    +
    +            // clear logProcess variable if logging process has exited so we won't try
to kill it later
    +            if (data.indexOf('No log channels enabled. Exiting...') !== -1) {
    --- End diff --
    
    Instead of hardcoding this to a particular error message - we should look for the 'close'
event on logProcess and set it to null, and log the corresponding error code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message