PageRenderTime 39ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/public/zf-demos/Zend/Wildfire/application/controllers/ZendLogWriterFirebugController.php

https://bitbucket.org/hieronim1981/tunethemusic
PHP | 94 lines | 52 code | 14 blank | 28 comment | 1 complexity | 3836863f4b28a9c1f6c24ee6d49696fd MD5 | raw file
  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-2012 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. /** Zend_Wildfire_Plugin_FirePhp */
  23. require_once 'Zend/Wildfire/Plugin/FirePhp.php';
  24. /**
  25. * Tests for Zend_Log_Writer_Firebug
  26. *
  27. * @category Zend
  28. * @package Zend_Wildfire
  29. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. class ZendLogWriterFirebugController extends Zend_Controller_Action
  33. {
  34. public function testloggingAction()
  35. {
  36. $logger = Zend_Registry::get('logger');
  37. $logger->log('Emergency: system is unusable', Zend_Log::EMERG);
  38. $logger->log('Alert: action must be taken immediately', Zend_Log::ALERT);
  39. $logger->log('Critical: critical conditions', Zend_Log::CRIT);
  40. $logger->log('Error: error conditions', Zend_Log::ERR);
  41. $logger->log('Warning: warning conditions', Zend_Log::WARN);
  42. $logger->log('Notice: normal but significant condition', Zend_Log::NOTICE);
  43. $logger->log('Informational: informational messages', Zend_Log::INFO);
  44. $logger->log('Debug: debug messages', Zend_Log::DEBUG);
  45. $logger->log(array('$_SERVER',$_SERVER), Zend_Log::DEBUG);
  46. $logger->trace('Trace to here');
  47. $table = array('Summary line for the table',
  48. array(
  49. array('Column 1', 'Column 2'),
  50. array('Row 1 c 1',' Row 1 c 2'),
  51. array('Row 2 c 1',' Row 2 c 2')
  52. )
  53. );
  54. $logger->table($table);
  55. }
  56. public function testgroupedloggingAction()
  57. {
  58. $logger = Zend_Registry::get('logger');
  59. Zend_Wildfire_Plugin_FirePhp::group("Collapsed Group", array('Collapsed' => true));
  60. $logger->log('Message in collapsed group', Zend_Log::DEBUG);
  61. Zend_Wildfire_Plugin_FirePhp::groupEnd();
  62. Zend_Wildfire_Plugin_FirePhp::group("Expanded Group", array('Collapsed' => false));
  63. $logger->log('Message in expanded group', Zend_Log::DEBUG);
  64. Zend_Wildfire_Plugin_FirePhp::groupEnd();
  65. }
  66. public function testerrorcontrollerAction()
  67. {
  68. require_once 'Zend/Exception.php';
  69. throw new Zend_Exception('Test Exception');
  70. }
  71. public function testlargemessageAction()
  72. {
  73. $message = array();
  74. for ( $i=0 ; $i<300 ; $i++ ) {
  75. $message[] = 'This is message #' . $i;
  76. }
  77. $logger = Zend_Registry::get('logger');
  78. $logger->log($message, Zend_Log::INFO);
  79. }
  80. }