Search code examples
javascripttitanium-mobileappcelerator

difference between Ti.API.info and console.log


I am newbie in Titanium Mobile and I start learning recently. So pardon me if I made a wrong question.

Out of curiosity, is there any difference between console.log() and Ti.API.info when it come to logging?


Solution

  • The difference is the Useful Context.

    Over HTML5 Projects or WebViews (inside .html), it is better use console.log due to on Android OS you see the messages on Titanium SDK Console and iOS on Organizer Xcode View and browser compatibility.

    Over Titanium Code, it is better use Ti.API.info due to this message is native code (Syso Android OS and NSLog iOS) so this code should be used at Titanium Mobile Project.