Titanium api.info never shows anything in the console

caiocpricci2 picture caiocpricci2 · May 23, 2012 · Viewed 9.2k times · Source

I've just started with titanium and I can't make the Ti.API.info("My log message") to print anything in the console.

I tried running the app in my Android device, in the Android Emulator, in the iPhone simulator and as a mobile web project in GoogleChrome, and the console window in Titanium Studio never prints my log message.

My last attempt was in the imported sample "Todo List". On the beginning of the file app.js I've added two log messages:

if (Ti.version < 1.8 ) {
    alert('Sorry - this application template requires Titanium Mobile SDK 1.8 or later');
}
else {
    Ti.API.error('my error');
    Ti.API.log('error','my error');

The app runs in the devices, in the emulators and in the browser, but this message is never shown.

I am using the latest version of Titanium Studio, the latest android SDK and xCode 4.2. Running on a Mac Os X 10.6.8.

Titanium Studio, build: 2.0.1.201204132053

I'll be glad to provide any other information that might indicate why this is not working.

Why this is not showing anything in the console?

Answer

hdogan picture hdogan · May 24, 2012
  • Go to Project -> Properties menu.
  • Select Run/Debug Settings on the left panel.
  • Click on Titanium iPhone Simulator - <your project name> on the list and than "Edit..." button.

There is "Log level" property on configuration properties "Platform" panel. Make sure that it's "Info", "Debug" or "Trace" to see Ti.API.info messages on console.

Clean your project and run it again.