tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

feat(android): indent log correctly #14030

Closed m1ga closed 6 months ago

m1ga commented 6 months ago

Remove the trim() from the logout put to keep e.g. JSON indentation.

console.log("#TEST#");
console.log([{"foo":"bar", "test": 1}]);
console.log(JSON.stringify([{"foo":"bar", "test": 1}]));
console.log(JSON.stringify([{"foo":"bar", "test": 1}], null, 2));

output with the PR:

[INFO]  #TEST#
[INFO]  [ { foo: 'bar', test: 1 } ]
[INFO]  [{"foo":"bar","test":1}]
[INFO]  [
[INFO]   {
[INFO]     "foo": "bar",
[INFO]     "test": 1
[INFO]   }
[INFO]  ]

output before:

[INFO]  #TEST#
[INFO]  [ { foo: 'bar', test: 1 } ]
[INFO]  [{"foo":"bar","test":1}]
[INFO]  [
[INFO]  {
[INFO]  "foo": "bar",
[INFO]  "test": 1
[INFO]  }
[INFO]  ]