钛api.info从来没有显示在控制台什么从来没有、控制台、api、info

2023-09-07 16:30:29 作者:痛de味道

我刚开始用钛和我不能让在 Ti.API.info(我的日志信息)打印在控制台东西。

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

我试图运行在Android设备应用程序,在Android模拟器,在iPhone模拟器,并在GoogleChrome一个移动网络项目,并在钛Studio中的控制台窗口打印从来没有我的日志信息。

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.

我最后的尝试是进口的样品待办事项列表的。在文件app.js的开始,我已经添加了两个日志消息:

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.

我使用的是最新版本的钛工作室,最新的Andr​​oid SDK和X code 4.2。对运行在Mac OS X 10.6.8。

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.

钛工作室,打造: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?

推荐答案

转到项目 - >属性菜单在左侧面板上选择运行/调试设置。单击钛iPhone模拟器 - &lt;您的项目名称&gt;在名单上,比编辑按钮。

有是配置属性平台面板上的日志级别属性。确保它的信息,调试和跟踪中看到控制台Ti.API.info消息。

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.