Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27342] iOS regression: Console.warn/error don't log all parameters

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-08-28T17:00:56.000+0000
Affected Version/sRelease 8.1.0
Fix Version/sRelease 8.1.1
ComponentsiOS
LabelsengSchedule, regression
ReporterRene Pot
AssigneeVijay Singh
Created2019-08-19T10:37:43.000+0000
Updated2019-08-28T23:32:47.000+0000

Description

When using console.log/warn/error usually all parameters get logged, however since SDK 8.1.0 this is no longer the case. If you run this code:
console.log('a', 'b');
console.warn('a', 'b');
console.error('a', 'b');
it will log:
[INFO]  a b
[WARN]  a
[ERROR] a 
It should log a b for all 3 types. It works fine for Android and iOS SDK 8.0.0.GA

Comments

  1. Vijay Singh 2019-08-21

    PR(8_1_X) - https://github.com/appcelerator/titanium_mobile/pull/11162 PR(Master) - https://github.com/appcelerator/titanium_mobile/pull/11163 PR(8_3_X) - https://github.com/appcelerator/titanium_mobile/pull/11164 Test Case 1.
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
       
       var btn = Ti.UI.createButton({
           title: 'Trigger'
       });
       
       btn.addEventListener('click', function() {
       Ti.API.debug({par1:'Ti API debug', par2:'a', par3:{par4: 'b', par5: 'c'}});
       Ti.API.error(['Ti API error', 'a', 'b'], 'c');
       Ti.API.info('Ti API info', false, 'b');
       Ti.API.log('info', 1, 'b');
       Ti.API.warn('Ti API warn', 'a', 'b');
       Ti.API.trace('Ti API trace', 'a', 'b');
        Ti.API.info(null);
        Ti.API.info(undefined);
       
       console.debug('console debug', 'a', 'b');
       console.error('console error', 'a', 'b');
       console.info('console info', 'a', 'b');
       console.log('console log', 'a', 'b');
       console.warn('console warn', 'a', 'b');
       console.trace('console trace', 'a', 'b');
       
       });
       
       win.add(btn);
       win.open();
       
    Test Case 2 -
       var htmlText =
               '<!DOCTYPE html>\n' +
               '<html>\n' +
               '   <head>\n' +
               '       <meta name="viewport" content="width=device-width, initial-scale=1.0">\n' +
               '   </head>\n' +
               '   <body>\n' +
               '       <p>HTML JavaScript Logging Test</p>\n' +
               '   </body>\n' +
               '   <script>\n' +
               '       document.addEventListener("DOMContentLoaded", function(e) {\n' +
               '           // Stopped working on iOS as of 8.1.0.\n' +
               '           Ti.API.info("@@@ Logging via Ti.API.info() method.");\n' +
               '           Ti.API.warn("@@@ Logging via Ti.API.warn() method.");\n' +
               '           Ti.API.error("@@@ Logging via Ti.API.error() method.");\n' +
               '           \n' +
               '           // Stopped working on iOS as of 8.0.0.\n' +
               '           Ti.API.log("info", "@@@ Logging via Ti.API.log(info,message) method.");\n' +
               '           Ti.API.log("warn", "@@@ Logging via Ti.API.log(warn,message) method.");\n' +
               '           Ti.API.log("error", "@@@ Logging via Ti.API.log(error,message) method.");\n' +
               '       });\n' +
               '   </script>\n' +
               '</html>\n';
        
       var window = Ti.UI.createWindow();
       var webView = Ti.UI.createWebView({
           html: htmlText,
       });
       window.add(webView);
       window.open();
       
  2. Lokesh Choudhary 2019-08-23

    FR Passed. Waiting for CR.
  3. Christopher Williams 2019-08-26

    See comment on the 8_1_X back port, this is crashing in our test suite for not properly handling undefined as an argument.
  4. Vijay Singh 2019-08-26

    [~cwilliams] Updated PR.
  5. Christopher Williams 2019-08-28

    Merged to master, 8_1_X and 8_3_X
  6. Keerthi Mahalingam 2019-08-28

    Verified the Fix on sdk 8.3.0.v20190828100616,8.2.0.v20190828134315 and 8.1.1.v20190828100656. console and Ti.APi logs works as expected.
       Test Environment:
       Version                     = 10.14.5
         Architecture                = 64bit
       Node.js
         Node.js Version             = 10.16.2
         npm Version                 = 6.9.0
       Titanium CLI
         CLI Version                 = 5.2.1
       Titanium SDK
         SDK Version                 = 8.3.0.v20190828100616,8.2.0.v20190828134315 and 8.1.1.v20190828100656
       Device -iPhone X iOS 11
       Simulator -iphone iOS 12 ,iPhone 8 iOS 13

JSON Source