Skip to content

Conversation

@m1ga
Copy link
Contributor

@m1ga m1ga commented May 15, 2023

fixes #13837

Needs: tidev/node-titanium-sdk#651

Instead of just hiding the debug/trace Ti.API calls in a production build it will NULL them and not execute the parameters! More info in the issue ticket.

let i = 0;
let c = 0;
Ti.API.info(`-------------INFO: ${++i}`);
Ti.API.debug(`-------------DEBUG: ${++i}`);
Ti.API.info(`-------------INFO: ${++i}`);

Test:

  • create a dev build
  • build with -l info and you should see INFO 1 and INFO 3
  • build a store build
  • run adb logcat | grep -i tiapi and launch your app
  • you should see INFO 1 and INFO 2

TODO:

  • Currently only a draft to see if it is useful or should be like this.
  • either do the same for console.debug or add the existing babel remover for that

@m1ga m1ga mentioned this pull request May 15, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize Ti.API.debug behaviour

2 participants