我的日志语句在 Mac 上打印在哪里?

发布于 2024-12-20 21:13:43 字数 450 浏览 2 评论 0原文

我有一个名为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦晓ヶ微光ヅ倾城 2024-12-27 21:13:43

该文本将转到错误控制台。您可能需要转到 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 change devtools.errorconsole.enabled preference to true - 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文