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 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)