我的日志语句在 Mac 上打印在哪里?
我有一个名为 myjavascriptfile.js 的 Firefox 扩展,因为我对这个插件概念很陌生,我只是想调试这个脚本。所以我在这个文件中使用以下语句,就像
function LOG(text)
{
var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage(text);
}
observe: function(subject, topic, data)
{
LOG("observe called ");
}
我知道这个观察被调用但我不知道知道在哪里查看我的日志消息。有人可以告诉我它在哪里打印吗? 请帮忙。
I have an firefox extension with the name myjavascriptfile.js,As I am new to this addon concepts,just I want to debug this script.So I am using the following statements in this file like
function LOG(text)
{
var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage(text);
}
observe: function(subject, topic, data)
{
LOG("observe called ");
}
I know this observe is getting called but I dont know where to see my log message.can some one tell me Where it is printing?
Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该文本将转到错误控制台。您可能需要转到
about:config
并将devtools.errorconsole.enabled
首选项更改为true
- 错误控制台已从菜单中删除不久前默认(奇怪的是,即使没有这个首选项我仍然可以看到它)。我认为在 OS X 上您仍然可以通过“工具”/“Web 开发人员”菜单打开错误控制台,在 Windows 上您必须单击 Firefox 按钮并选择“Web 开发人员”菜单。或者,Command-Shift-J 也可以。That text goes to the Error Console. You might need to go to
about:config
and changedevtools.errorconsole.enabled
preference totrue
- the Error Console was removed from the menus by default while ago (strangely enough, I could still see it even without this pref). I think that on OS X you can still open the Error Console via Tools / Web Developer menu, on Windows you have to click the Firefox button and choose Web Developer menu there. Alternatively, Command-Shift-J should do as well.