2013-10-03 1 views
0

나는 ajax 호출에서 firephp 및 firebug를 사용하여 일부 정보를 표시하려고합니다 .Ajax 호출이 완료되면 someinfo를 표시 할 수 있습니다. 실행하는 동안 표시 할 수있는 방법이 있습니까? 예를 들어 foreach 루프 안에있는 id 아래의 코드.Firephp를 사용하여 Firebug의 정보를 표시하는 방법

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()를 표시하려고합니다.

가능합니까?

감사합니다.

답변

1

FirePHP는 PHP 스크립트가 실행되는 동안 로그 정보를 수집하도록 설계된 다음 페이지 응답과 함께 특수 헤더로 보냅니다. Firebug에서 로깅 호출을 실시간으로 표시하지 않습니다.

로깅을 사용하여 코드를 디버깅하려면 더 많은 로깅 호출을 루프에 배치하십시오. 예 :

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

는 각 반복에 $value에 새로운 값을 할당하지만 루프에서 문 중 하나에 그것을 사용하지 않는 루프를 가지고있다. 그건 맞지 않아.

실시간 디버깅이 필요한 경우 xDebug 또는 기타 실시간 로깅 도구를 사용하는 것이 좋습니다.