titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

CLI: "console.*" functionality does not work as expected

Open jasonkneen opened this issue 4 years ago • 1 comments

Console is supposed to support .group capabilties according to the documentation but this doesn't work in practice.

console.group("URL Details");
console.log("Scheme: HTTPS");
console.log("Host: example.com");
console.groupEnd();

Should render the two items in a group (indented)

Can this functionality be implemented or the docs updated to remove it?

jasonkneen avatar Feb 09 '21 14:02 jasonkneen

It actually is implemented at the console level here: https://github.com/appcelerator/titanium_mobile/blob/master/common/Resources/ti.internal/extensions/js/console.js#L74-L83

The issue is in the CLI hooks that print the logs to the terminal/shell - they do some trimming of the output:

  • Android: https://github.com/appcelerator/titanium_mobile/blob/master/android/cli/hooks/run.js#L241-L314
  • iOS: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/hooks/run.js#L63-L80

sgtcoolguy avatar Mar 09 '21 17:03 sgtcoolguy