[ 
https://issues.apache.org/jira/browse/CB-8936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14730407#comment-14730407
 ] 

ASF GitHub Bot commented on CB-8936:
------------------------------------

Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/119#discussion_r38726108
  
    --- Diff: template/cordova/lib/log.js ---
    @@ -30,33 +30,87 @@ var platformRoot = path.join(__dirname, '..', '..'),
         configPath   = path.join(projectRoot, 'config.xml');
     
     // variables
    -var appTracingInitialState = null,
    +var appTracingLog          = 
'Microsoft-Windows-AppHost/ApplicationTracing',
    +    appTracingInitialState = null,
         appTracingCurrentState = null,
    -    adminInitialState = null,
    -    adminCurrentState = null,
    +    adminLog               = 'Microsoft-Windows-AppHost/Admin',
    +    adminInitialState      = null,
    +    adminCurrentState      = null,
    +    timers                 = [],
         appName;
     
     /*
      * Gets windows AppHost/ApplicationTracing and AppHost/Admin logs
      * and prints them to console
      */
    -module.exports.run = function() {
    -    getLogState('Microsoft-Windows-AppHost/Admin').then(function (state) {
    +module.exports.run = function(args) {
    +    var dump = false, 
    +        startTime = new Date(new Date().getTime() - 10 * 60 * 
1000).toISOString(); // show last 10 minutes by default
    +
    +    if (args.length > 0) {
    +        for (var i = 0; i < args.length; i++) {
    +            switch (args[i]) {
    +                case '--startTime':
    +                case '-t':
    +                    if (i < args.length - 1) {
    +                        startTime = args[++i];
    +                    }
    +                    break;
    +                case '--dump':
    +                case '-d':
    +                    dump = true;
    +                    break;
    +                case '--help':
    +                case '-h':
    +                    module.exports.help();
    +                    return;
    +                default:
    +                    console.warn('Ignoring unknown arg: ' + args[i]);
    +            }
    +        }
    +    }
    +
    +    if (dump) {
    +        console.log('Dumping logs starting from ' + startTime);
    +        var appTracingEvents, adminEvents;
    +        getEvents(appTracingLog, startTime).then(function (evts) {
    +            appTracingEvents = evts;
    +            return getEvents(adminLog, startTime);
    +        }).then(function(evts) {
    +            adminEvents = evts;
    +            appTracingEvents.concat(adminEvents)
    +            .sort(function(evt1, evt2) {
    +                if (evt1.timeCreated < evt2.timeCreated) {
    +                    return -1;
    --- End diff --
    
    if `evt*.timeCreated` is a Number, you might want to simplify this to 
`return evt1.timeCreated - evt2.timeCreated;`


> Surface platform-specific logs in buildbot
> ------------------------------------------
>
>                 Key: CB-8936
>                 URL: https://issues.apache.org/jira/browse/CB-8936
>             Project: Apache Cordova
>          Issue Type: Task
>          Components: Medic
>            Reporter: Alexander Sorokin
>            Assignee: Alexander Sorokin
>
> Platform specific logs (e.g. logcat for android, stderr.log and stdin.log for 
> iOS etc.) should be gathered and displayed in buildbot.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to