You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by alsorokin <gi...@git.apache.org> on 2015/07/03 16:35:21 UTC

[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

GitHub user alsorokin opened a pull request:

    https://github.com/apache/cordova-medic/pull/58

    CB-8936 Gathering logs on Windows

    https://issues.apache.org/jira/browse/CB-8936

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-medic CB-8936

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-medic/pull/58.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #58
    
----
commit 36d9d6875e800332f7c7da108e66b8b179ce9413
Author: alsorokin <al...@akvelon.com>
Date:   2015-07-03T14:33:54Z

    CB-8936 Gathering logs on Windows

----


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


[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/58#discussion_r33955321
  
    --- Diff: medic/medic-run.js ---
    @@ -232,12 +233,18 @@ function windowsSpecificPreparation(argv) {
                 /^\s*\$appActivator .*$/gim,
                 "$&\n" +
                 "    powershell " + path.join(process.cwd(), destScriptPath) + " $$ID\n" +
    +            "    powershell " + path.join(process.cwd(), logScriptPath) + "\n" +
                 "    $Ole32 = Add-Type -MemberDefinition '[DllImport(\"Ole32.dll\")]public static extern int CoAllowSetForegroundWindow(IntPtr pUnk, IntPtr lpvReserved);' -Name 'Ole32' -Namespace 'Win32' -PassThru\n" +
                 "    $Ole32::CoAllowSetForegroundWindow([System.Runtime.InteropServices.Marshal]::GetIUnknownForObject($appActivator), [System.IntPtr]::Zero)",
                 appUtilsPath
             );
         }
     
    +    // write current time to a file to use it when gathering logs
    +    var now = new Date();
    +    var iso = now.toISOString();
    +    fs.writeFileSync('startTime.txt', iso, util.DEFAULT_ENCODING);
    --- End diff --
    
    Are we definitely writing to a file "startTime.txt"?  That seems like it'd be repeatedly overwritten and we'd lose data.


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


[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

Posted by alsorokin <gi...@git.apache.org>.
Github user alsorokin closed the pull request at:

    https://github.com/apache/cordova-medic/pull/58


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


[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/58#discussion_r33955365
  
    --- Diff: medic/medic-run.js ---
    @@ -232,12 +233,18 @@ function windowsSpecificPreparation(argv) {
                 /^\s*\$appActivator .*$/gim,
                 "$&\n" +
    --- End diff --
    
    Mixing PS and JS in this way === gross.


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


[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-medic/pull/58#issuecomment-118368144
  
    This seems useful. If it works well you should add it to cordova-windows with a 'log' script, similar to how other platforms do it and just invoke it from there.


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


[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/58#discussion_r34749192
  
    --- Diff: medic/medic-run.js ---
    @@ -232,12 +233,18 @@ function windowsSpecificPreparation(argv) {
                 /^\s*\$appActivator .*$/gim,
                 "$&\n" +
    --- End diff --
    
    This was copied over from the old Medic code. Having said that, improvements are in order at some point.


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


[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/58#discussion_r34748954
  
    --- Diff: medic/medic-run.js ---
    @@ -222,6 +222,7 @@ function windowsSpecificPreparation(argv) {
             var appUtilsPath   = path.join(libPath, "WindowsStoreAppUtils.ps1");
             var srcScriptPath  = path.join(CORDOVA_MEDIC_DIR, "lib", "patches", "EnableDebuggingForPackage.ps1");
             var destScriptPath = path.join(libPath, "EnableDebuggingForPackage.ps1");
    +        var logScriptPath  = path.join(CORDOVA_MEDIC_DIR, "lib", "patches", "EnableLogging.ps1");
    --- End diff --
    
    Should this be part of the cordova-windows platform template?


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


[GitHub] cordova-medic pull request: CB-8936 Gathering logs on Windows

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/58#discussion_r34749430
  
    --- Diff: medic/medic-run.js ---
    @@ -232,12 +233,18 @@ function windowsSpecificPreparation(argv) {
                 /^\s*\$appActivator .*$/gim,
                 "$&\n" +
                 "    powershell " + path.join(process.cwd(), destScriptPath) + " $$ID\n" +
    +            "    powershell " + path.join(process.cwd(), logScriptPath) + "\n" +
                 "    $Ole32 = Add-Type -MemberDefinition '[DllImport(\"Ole32.dll\")]public static extern int CoAllowSetForegroundWindow(IntPtr pUnk, IntPtr lpvReserved);' -Name 'Ole32' -Namespace 'Win32' -PassThru\n" +
                 "    $Ole32::CoAllowSetForegroundWindow([System.Runtime.InteropServices.Marshal]::GetIUnknownForObject($appActivator), [System.IntPtr]::Zero)",
                 appUtilsPath
             );
         }
     
    +    // write current time to a file to use it when gathering logs
    +    var now = new Date();
    +    var iso = now.toISOString();
    +    fs.writeFileSync('startTime.txt', iso, util.DEFAULT_ENCODING);
    --- End diff --
    
    This file is not necessary. It serves only to pass arguments from `medic-run` to `medic-log`. Instead, please pass a start time to medic-log on the command line from `cordova.conf`. You can do this by setting a `Property` using `SetPropertyFromCommand`, and then passing it to the logging step.


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