Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27345

Improve console debugging capabilities with util.inspect

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 8.1.0
    • Fix Version/s: Release 8.3.0
    • Component/s: Core
    • Labels:
      None
    • Story Points:
      21

      Description

      Debugging with any of the console or Ti.API logging functions needs some improvement when it comes to printing object structures. Since 8.1.0.GA printing an object simply outputs [object Object] in some cases which is not very useful.

      With TIMOB-26670 we now have util.inspect available and we should hook that up with console and Ti.API just like Node.js does for extensive logging/debugging capabilities.

      A few examples:

      const a = {};
      a.b = a;
      console.log(a); // crashes on 8.0.1.GA, or just prints "[object Object]" on 8.1.0.GA
       
      const b = {
        foo: 'bar'
      }
      console.log(b); // prints "{ foo: 'bar' }" on 8.0.1.GA, or just "[object Object]" on 8.1.0.GA
       
      const map = new Map();
      map.set('foo', 'bar');
      console.log(map); // prints "{}" on 8.0.1.GA, or just "[object Map]" on 8.1.0.GA
      

        Attachments

          Activity

            People

            • Assignee:
              jvennemann Jan Vennemann
              Reporter:
              jvennemann Jan Vennemann
              Reviewer:
              Christopher Williams
              Tester:
              Sohail Saddique
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration