ZendLogWriterFirebugController.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Wildfire
  17. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /** Zend_Controller_Action */
  21. require_once 'Zend/Controller/Action.php';
  22. /**
  23. * Tests for Zend_Log_Writer_Firebug
  24. *
  25. * @category Zend
  26. * @package Zend_Wildfire
  27. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  28. * @license http://framework.zend.com/license/new-bsd New BSD License
  29. */
  30. class ZendLogWriterFirebugController extends Zend_Controller_Action
  31. {
  32. public function testloggingAction()
  33. {
  34. $logger = Zend_Registry::get('logger');
  35. $logger->log('Emergency: system is unusable', Zend_Log::EMERG);
  36. $logger->log('Alert: action must be taken immediately', Zend_Log::ALERT);
  37. $logger->log('Critical: critical conditions', Zend_Log::CRIT);
  38. $logger->log('Error: error conditions', Zend_Log::ERR);
  39. $logger->log('Warning: warning conditions', Zend_Log::WARN);
  40. $logger->log('Notice: normal but significant condition', Zend_Log::NOTICE);
  41. $logger->log('Informational: informational messages', Zend_Log::INFO);
  42. $logger->log('Debug: debug messages', Zend_Log::DEBUG);
  43. $logger->log(array('$_SERVER',$_SERVER), Zend_Log::DEBUG);
  44. $logger->trace('Trace to here');
  45. $table = array('Summary line for the table',
  46. array(
  47. array('Column 1', 'Column 2'),
  48. array('Row 1 c 1',' Row 1 c 2'),
  49. array('Row 2 c 1',' Row 2 c 2')
  50. )
  51. );
  52. $logger->table($table);
  53. }
  54. public function testerrorcontrollerAction()
  55. {
  56. require_once 'Zend/Exception.php';
  57. throw new Zend_Exception('Test Exception');
  58. }
  59. public function testlargemessageAction()
  60. {
  61. $message = array();
  62. for ( $i=0 ; $i<300 ; $i++ ) {
  63. $message[] = 'This is message #' . $i;
  64. }
  65. $logger = Zend_Registry::get('logger');
  66. $logger->log($message, Zend_Log::INFO);
  67. }
  68. }