【问题标题】:how to display info in Firebug using Firephp如何使用 Firephp 在 Firebug 中显示信息
【发布时间】:2013-10-05 01:14:51
【问题描述】:

我正在尝试使用 firephp 和 firebug 显示来自 ajax 调用的一些信息。当 ajax 调用完成时,我能够显示一些信息。有没有办法在执行时显示?例如,我在 foreach 循环中的 id 下面的代码。

foreach ($this->PreQualcalls as $value) {    
ob_start();
if(isset($array ['env:Envelope'] ['env:Body']['n1:preQualResponse1207'])){
                $this->setKeyNamePreQualResponse("n1:preQualResponse1207");
                $this->setKeyNameServiceProducts("n1:ServiceProduct1207");
                $this->setKeyNameModemProducts("n1:ModemProduct1207");
                $this->firephp->log("entered the 1207 call");
            }else{
                $this->setKeyNamePreQualResponse("n1:preQual1308Response");
                $this->setKeyNameServiceProducts("n1:ServiceProduct1308");
                $this->setKeyNameModemProducts("n1:ModemProduct1308");
                $this->firephp->log("entered the 1308 call");
            }
ob_flush();
$this->firephp->log($this->getKeyNamePreQualResponse(),"Response type");
}

我希望能够在控制台中显示 getKeyNamePreQualResponse(),因为它正在通过循环。

有可能吗?

谢谢。

【问题讨论】:

    标签: php firebug firephp


    【解决方案1】:

    FirePHP 旨在在 PHP 脚本执行时收集日志信息,然后将其与页面响应一起发送到特殊标头中。它不会在 Firebug 中实时显示日志调用。

    要使用日志记录调试代码,请将更多日志记录调用放入循环中。例如

    $this->firephp->log("value", $value);
    

    您有一个循环,它在每次迭代时为$value 分配一个新值,但不要在循环中的任何语句中使用它。这似乎不对。

    如果您需要实时调试,我建议使用 xDebug 或其他实时日志记录工具。

    【讨论】:

      猜你喜欢
      • 2015-05-13
      • 1970-01-01
      • 2013-08-26
      • 1970-01-01
      • 1970-01-01
      • 2012-01-30
      • 1970-01-01
      • 1970-01-01
      • 2011-09-27
      相关资源
      最近更新 更多