cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject cordova-medic git commit: CB-8936 Utilizing --dump flag for logs on Windows
Date Wed, 09 Sep 2015 22:07:13 GMT
Repository: cordova-medic
Updated Branches:
  refs/heads/master 5e596ead9 -> c8f6bb283


CB-8936 Utilizing --dump flag for logs on Windows


Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/c8f6bb28
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/c8f6bb28
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/c8f6bb28

Branch: refs/heads/master
Commit: c8f6bb2833cd3e16cb5458f8eb35a152340e5340
Parents: 5e596ea
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Authored: Wed Sep 2 16:39:48 2015 +0300
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Wed Sep 9 15:45:27 2015 +0300

----------------------------------------------------------------------
 medic/medic-log.js | 17 +++++++----------
 medic/medic-run.js | 19 -------------------
 2 files changed, 7 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/c8f6bb28/medic/medic-log.js
----------------------------------------------------------------------
diff --git a/medic/medic-log.js b/medic/medic-log.js
index 6f09ff2..60ceef9 100644
--- a/medic/medic-log.js
+++ b/medic/medic-log.js
@@ -64,17 +64,14 @@ function logIOS() {
 }
 
 function logWindows() {
-    fs.readFile("./out.log", { encoding: util.DEFAULT_ENCODING }, function(err, log) {
-        if (err) {
-            if (err.toString().indexOf("ENOENT") > -1) {
-                throw new Error("Couldn't find log file. It may be because of old cordova-windows
version or some problems with log script.");
-            } else {
-                throw err;
+    var logScriptPath = path.join("mobilespec", "platforms", "windows", "cordova", "log.bat");
+    if (fs.existsSync(logScriptPath)) {
+        shelljs.exec(logScriptPath + " --dump", function (code, output) {
+            if (code > 0) {
+                util.fatal("Failed to run log command.");
             }
-        } else {
-            console.log(log);
-        }
-    });
+        });
+    }
 }
 
 function logWP8() {

http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/c8f6bb28/medic/medic-run.js
----------------------------------------------------------------------
diff --git a/medic/medic-run.js b/medic/medic-run.js
index 8eaf66f..0447d8b 100644
--- a/medic/medic-run.js
+++ b/medic/medic-run.js
@@ -239,25 +239,6 @@ function windowsSpecificPreparation(argv) {
             "    $Ole32::CoAllowSetForegroundWindow([System.Runtime.InteropServices.Marshal]::GetIUnknownForObject($appActivator),
[System.IntPtr]::Zero)",
             appUtilsPath
         );
-        
-         // 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 });
-            });
-            logProcess.on('close', function () {
-                // clear logProcess variable if logging process has exited so we won't try
to kill it later
-                logProcess = null;
-            });
-        }
     }
 
     return extraArgs;


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


Mime
View raw message