FirePHP 是否受到重定向时 Firebug 控制台清除的限制?
我正在使用 FirePHP 和 Zend Framework。
当用户提交表单时,我希望将一些数据输出到 Firebug 控制台,而 FirePHP 非常适合这项工作。
这一切似乎工作正常,除了当我的服务器代码处理表单时,它然后重定向到另一个页面 - 使用 Zend 的 _redirect() - 导致 Firebug 清除控制台。所以我永远看不到记录的输出。
如果我阻止重定向,那么我会看到输出(但这不是表单提交的典型工作流程 - 我提交相同的操作,验证和处理,然后重定向到我希望用户结束的位置。)这是一个已建立的网络应用程序。
有什么解决方法吗?我可能不得不日志记录到数据库或文件,但 Firebug 控制台是我记录日志的理想位置。
I am using FirePHP with Zend Framework.
When the user submits a form, I wish to output some data to the Firebug console and FirePHP is perfect for the job.
This all seems to work fine, except that when my server code processes the form, it then redirects to another page - using Zend's _redirect() - causing Firebug to clear the console. So I never get to see the logged output.
If I prevent the redirect, then I see the output (but that's not a typical workflow for form submission - I submit to the same action, validate and process and then redirect where I want the user to end up.) This is an established web app.
Is there any workaround for this? I might have to resort to logging to a database or file, but the Firebug console is the ideal place for what I'm logging.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我遇到了与上面描述的相同的问题(使用 Kohana3)。
解决方案在于 FireBug (1.5) 的稳定
beta版本:http://getfirebug.com/releases/firebug/1.5X/
最新版本在底部!
0.4.3
它对我来说开箱即用。
此版本的 FireBug 具有持久控制台选项,即使您多次重新加载页面,所有日志和信息也会保留在控制台中。
不幸的是,在 1.5X.0b8 中,它出现了错误并且无法正确触发:< Strike>code.google.com/p/fbug/issues/detail?id=2659&sort=-id&colspec=ID%20Type%20Status%20Owner%20Test%20Summary
自发布以来,Persistend 控制台现在工作得很好FBug 1.5 稳定。
玩得开心并问候!
I had the same problem as described above (using Kohana3).
The solution lies in the stable
betaversion of FireBug (1.5) :http://getfirebug.com/releases/firebug/1.5X/
The newest version is at the bottom!
0.4.3
It works for me out of the box.
This version of FireBug has Persistent Console option, which makes all the logs and information stay in the console even if you reload the page many times.
Unfortunately in 1.5X.0b8 it's bugged and not properly triggered:code.google.com/p/fbug/issues/detail?id=2659&sort=-id&colspec=ID%20Type%20Status%20Owner%20Test%20SummaryPersistend Console works great now, since realease of FBug 1.5 Stable.
Have fun and regards!
不幸的是,不会,Firebug 在每次点击页面时都会清除控制台。您可以做的是将消息保存到会话条目,并在重新加载页面时将所有消息发送到 Firebug 控制台。
Unfortunately no, Firebug clears the console on every page hit. What you can do is save the messages to a session entry, and upon reloading the page send all of the messages to the Firebug console.
我即将遇到类似的问题。这并不理想,但是您是否尝试过查看 firebug 中的“Net”选项卡,单击您想要查看其消息的请求,然后查看标头...它打印得不太好,但是你的控制台消息应该都在那里。
I'm coming up w/ similar issues. This isn't ideal but have you tried to look at the "Net" tab in firebug, click on the request whose messages you want to look at, then look at the headers... it doesn't print out as nicely, but your console messages should all be there.
我要做的是覆盖重定向器帮助程序,以不重定向并输出链接,也许在 APPLICATION_ENV == 'development' 的开关上。这样您的控制器代码就不会受到影响,并且您仍然可以逐步完成您的过程。
What I would do is override the redirector helper to not rediect and output a link instead, maybe on a switch of APPLICATION_ENV == 'development'. This way your controller code is unaffected, and it would yet you step through your process.
当页面重定向但我需要在 firebug 中看到一些内容时我会做什么(通常带有诸如
之类的链接其中
foo()
中发生错误的地方是单击,然后混搭转义键以取消重定向。What I do when a page redirects but there is something I need to see in firebug (usually with links like
<a href="foobar" onclick="foo(); return false;">
where an error occurs infoo()
) is click and then mash the escape key to cancel the redirect.火记录器
FirePHP 的替代品,也是 Firebug 插件。据说是为了解决这里概述的确切问题。
FireLogger
An alternative to FirePHP, also a Firebug addon. Said to remedy the exact problem outlined here.