dongnaota6386 2011-03-16 07:28
浏览 23
已采纳

Zend_Log_Writer_Firebug()无效

I have Firefox 3.6.15, Firebug and FirePHP addons installed, console enabled. I am using Zend 1.11. The following code doesn't show anything in the firebug console.

<?php
    require_once('Zend/Log.php');
    require_once('Zend/Log/Writer/Firebug.php');

    $writer = new Zend_Log_Writer_Firebug();
    $logger = new Zend_Log($writer);

    $logger->info('info message');
    $logger->warn('warning message');
    $logger->err('error message');
?>

I tried with the FirePHP core library and this works -

<?php
     require_once('FirePHPCore/FirePHP.class.php');
     ob_start();

     $firephp = FirePHP::getInstance(true); 
     $var = array('i'=>10, 'j'=>20);

     $firephp->log($var, 'Iterators');
?>

Would like to get the Zend thing working. Any idea?

  • 写回答

2条回答 默认 最新

  • doutan2228 2011-03-16 07:38
    关注

    Try with place

    $request = new Zend_Controller_Request_Http();
    $response = new Zend_Controller_Response_Http();
    $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
    $channel->setRequest($request);
    $channel->setResponse($response);
    //buffering
    ob_start();
    

    before logger message.

    also after

    // flushing
    $channel->flush();
    $response->sendHeaders();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?