[TIMOB-27345] Improve console debugging capabilities with util.inspect
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-10-04T14:30:02.000+0000 |
Affected Version/s | Release 8.1.0 |
Fix Version/s | Release 8.3.0 |
Components | Core |
Labels | n/a |
Reporter | Jan Vennemann |
Assignee | Jan Vennemann |
Created | 2019-08-20T20:33:14.000+0000 |
Updated | 2019-10-04T14:30:02.000+0000 |
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
PR: https://github.com/appcelerator/titanium_mobile/pull/11165
FR Passed: Waiting on Jenkins build
merged to master
*Verified working* Test environment Studio Ver: 5.1.4.201909061933 SDK Ver: 8.3.0.v20191003144543 OS Ver: 10.14.6 Appc NPM: 4.2.15 Appc CLI: 7.1.1 Node Ver: 10.16.3 NPM Ver: 6.11.3 Emulator: ⇨ Pixel 3 (Android 9) *Output*
Ticket closed.