13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Log |
16 * @package Zend_Log |
17 * @subpackage Writer |
17 * @subpackage Writer |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: Firebug.php 23066 2010-10-09 23:29:20Z cadorn $ |
20 * @version $Id: Firebug.php 24593 2012-01-05 20:35:02Z matthew $ |
21 */ |
21 */ |
22 |
22 |
23 /** Zend_Log */ |
23 /** Zend_Log */ |
24 require_once 'Zend/Log.php'; |
24 require_once 'Zend/Log.php'; |
25 |
25 |
36 * Writes log messages to the Firebug Console via FirePHP. |
36 * Writes log messages to the Firebug Console via FirePHP. |
37 * |
37 * |
38 * @category Zend |
38 * @category Zend |
39 * @package Zend_Log |
39 * @package Zend_Log |
40 * @subpackage Writer |
40 * @subpackage Writer |
41 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
41 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
42 * @license http://framework.zend.com/license/new-bsd New BSD License |
42 * @license http://framework.zend.com/license/new-bsd New BSD License |
43 */ |
43 */ |
44 class Zend_Log_Writer_Firebug extends Zend_Log_Writer_Abstract |
44 class Zend_Log_Writer_Firebug extends Zend_Log_Writer_Abstract |
45 { |
45 { |
46 |
|
47 /** |
46 /** |
48 * Maps logging priorities to logging display styles |
47 * Maps logging priorities to logging display styles |
|
48 * |
49 * @var array |
49 * @var array |
50 */ |
50 */ |
51 protected $_priorityStyles = array(Zend_Log::EMERG => Zend_Wildfire_Plugin_FirePhp::ERROR, |
51 protected $_priorityStyles = array(Zend_Log::EMERG => Zend_Wildfire_Plugin_FirePhp::ERROR, |
52 Zend_Log::ALERT => Zend_Wildfire_Plugin_FirePhp::ERROR, |
52 Zend_Log::ALERT => Zend_Wildfire_Plugin_FirePhp::ERROR, |
53 Zend_Log::CRIT => Zend_Wildfire_Plugin_FirePhp::ERROR, |
53 Zend_Log::CRIT => Zend_Wildfire_Plugin_FirePhp::ERROR, |
57 Zend_Log::INFO => Zend_Wildfire_Plugin_FirePhp::INFO, |
57 Zend_Log::INFO => Zend_Wildfire_Plugin_FirePhp::INFO, |
58 Zend_Log::DEBUG => Zend_Wildfire_Plugin_FirePhp::LOG); |
58 Zend_Log::DEBUG => Zend_Wildfire_Plugin_FirePhp::LOG); |
59 |
59 |
60 /** |
60 /** |
61 * The default logging style for un-mapped priorities |
61 * The default logging style for un-mapped priorities |
|
62 * |
62 * @var string |
63 * @var string |
63 */ |
64 */ |
64 protected $_defaultPriorityStyle = Zend_Wildfire_Plugin_FirePhp::LOG; |
65 protected $_defaultPriorityStyle = Zend_Wildfire_Plugin_FirePhp::LOG; |
65 |
66 |
66 /** |
67 /** |
67 * Flag indicating whether the log writer is enabled |
68 * Flag indicating whether the log writer is enabled |
|
69 * |
68 * @var boolean |
70 * @var boolean |
69 */ |
71 */ |
70 protected $_enabled = true; |
72 protected $_enabled = true; |
71 |
73 |
72 /** |
74 /** |
73 * Class constructor |
75 * Class constructor |
|
76 * |
|
77 * @return void |
74 */ |
78 */ |
75 public function __construct() |
79 public function __construct() |
76 { |
80 { |
77 if (php_sapi_name() == 'cli') { |
81 if (php_sapi_name() == 'cli') { |
78 $this->setEnabled(false); |
82 $this->setEnabled(false); |
79 } |
83 } |
80 |
84 |
81 $this->_formatter = new Zend_Log_Formatter_Firebug(); |
85 $this->_formatter = new Zend_Log_Formatter_Firebug(); |
82 } |
86 } |
83 |
87 |
84 /** |
88 /** |
85 * Create a new instance of Zend_Log_Writer_Firebug |
89 * Create a new instance of Zend_Log_Writer_Firebug |
86 * |
90 * |
87 * @param array|Zend_Config $config |
91 * @param array|Zend_Config $config |
88 * @return Zend_Log_Writer_Firebug |
92 * @return Zend_Log_Writer_Firebug |
89 * @throws Zend_Log_Exception |
|
90 */ |
93 */ |
91 static public function factory($config) |
94 static public function factory($config) |
92 { |
95 { |
93 return new self(); |
96 return new self(); |
94 } |
97 } |