Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24278] iOS: CLI - Console logs align to left even when logging object properties and subproperties

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusResolved
ResolutionCannot Reproduce
Resolution Date2017-01-09T15:12:52.000+0000
Affected Version/sRelease 6.0.0, Release 6.0.1
Fix Version/sn/a
ComponentsiOS
Labelsconsole, indentation
ReporterRicardo Pereira
AssigneeUnknown
Created2017-01-05T19:10:22.000+0000
Updated2018-02-28T19:54:48.000+0000

Description

After the Appcelerator 4.8.0, I've noticed that the logs are always align at the left side without spaces/tabs before, before that, if the log is a JS object or array it should have some space or tab to distinguish from its parent. *OLD WAY:*
[INFO] {
[INFO]      prop1: "val1",
[INFO]      prop2: "val2",
[INFO]      prop3: {
[INFO]            subprop: "subval"
[INFO]      }
[INFO] }
*NOW:*
[INFO] {
[INFO] prop1: "val1",
[INFO] prop2: "val2",
[INFO] prop3: {
[INFO] subprop: "subval"
[INFO] }
[INFO] }
!Screen Shot 2017-01-05 at 11.50.16.png|thumbnail!

Attachments

FileDateSize
Screen Shot 2017-01-05 at 11.50.16.png2017-01-05T19:10:12.000+000049852

Comments

  1. Sharif AbuDarda 2017-01-05

    Hi, I can't reproduce the issue in iOS with the below code section.
       Ti.API.info({
       
               infomation : "appcelerator",
       
               logical : "appcelerator",
       
               warning : {
       
                   subwarning : "appcelerator"
               }
       
           });
       
    I got
       [INFO]  {
       [INFO]      infomation = appcelerator;
       [INFO]      logical = appcelerator;
       [INFO]      warning =     {
       [INFO]          subwarning = appcelerator;
       [INFO]      };
       [INFO]  }
       
    Properly indented. Test environment for studio 4.8.1.201612050850
       Operating System
         Name                        = Mac OS X
         Version                     = 10.12.2
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       
       Node.js
         Node.js Version             = 4.7.0
         npm Version                 = 2.15.11
       
       Titanium CLI
         CLI Version                 = 5.0.11
       
       Titanium SDK
         SDK Version                 = 6.0.1.GA
         Target Platform             = iphone
       
    Tested in studio and terminal. Please update SDK and CLI. Thanks.
  2. Hans Knöchel 2017-01-05

    [~ricardo_jcp] Thanks for this additional ticket! Please provide us your node-version, it must be something like that.
  3. Ricardo Pereira 2017-01-06

    Appcelerator Command-Line Interface, version 6.1.0 Copyright (c) 2014-2017, Appcelerator, Inc. All Rights Reserved. Operating System Name = Mac OS X Version = 10.12.1 Architecture = 64bit # CPUs = 2 Memory = 8.0GB Node.js Node.js Version = 4.6.2 npm Version = 2.15.11 Appcelerator CLI Installer = 4.2.8 Core Package = 6.1.0 Titanium CLI CLI Version = 5.0.11 node-appc Version = 0.2.39 Titanium SDKs 6.0.1.GA Version = 6.0.1 Install Location = /Users/rpereira/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA Platforms = iphone, android, mobileweb git Hash = 265db0d git Timestamp = 12/20/2016 00:55 node-appc Version = 0.2.39
  4. Hans Knöchel 2017-01-08

    [~cbarber] You having an idea why this could happen?
  5. Ricardo Pereira 2017-01-08

    could be the node js version? Node.js Version = 4.6.2 npm Version = 2.15.11 in the appc 4.8.0 changelog says that the latest is 4.6.x, but I've saw a stack overflow question or a jira ticket (don't remember) that only worked between 4.2.0 and 4.6.0
  6. Chris Barber 2017-01-09

    We trim log messages ONLY when it begins with a known log tag such as \[info\]. If the app logs a multi-line output, subsequent lines should not be trimmed. I just tested with Titanium SDK master (6.1.0) and I couldn't reproduce. I tried both Ti.API.log() and console.log().
       [INFO]  {
       [INFO]      bleh = "<null>";
       [INFO]      bye = bye;
       [INFO]      foo = bar;
       [INFO]      num = 123;
       [INFO]      things =     (
       [INFO]          a,
       [INFO]          b,
       [INFO]          c
       [INFO]      );
       [INFO]  }
       
    Even if there is a bug here, it's almost certainly NOT because of the Node.js version.
  7. Hans Knöchel 2017-01-09

    Resolving as Cannot Reproduce for now, since all three Engineering tests could not reproduce this issue. The logged data in your image looks like some kind of API, so maybe you JSON-stringifies it and forgot to set an indentation level to it? Or some other node-dependency making problems here. If nothing helps, reinstall the CLI and cleanup your other dependencies to have a fresh install. I hope that helps for now. Thanks!

JSON Source