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: Abstract.php 22567 2010-07-16 03:32:31Z ramon $ |
20 * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ |
21 */ |
21 */ |
22 |
22 |
23 /** Zend_Log_Filter_Priority */ |
23 /** Zend_Log_Filter_Priority */ |
24 require_once 'Zend/Log/Filter/Priority.php'; |
24 require_once 'Zend/Log/Filter/Priority.php'; |
25 |
25 |
26 /** |
26 /** |
27 * @category Zend |
27 * @category Zend |
28 * @package Zend_Log |
28 * @package Zend_Log |
29 * @subpackage Writer |
29 * @subpackage Writer |
30 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
30 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
31 * @license http://framework.zend.com/license/new-bsd New BSD License |
31 * @license http://framework.zend.com/license/new-bsd New BSD License |
32 * @version $Id: Abstract.php 22567 2010-07-16 03:32:31Z ramon $ |
32 * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ |
33 */ |
33 */ |
34 abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface |
34 abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface |
35 { |
35 { |
36 /** |
36 /** |
37 * @var array of Zend_Log_Filter_Interface |
37 * @var array of Zend_Log_Filter_Interface |
38 */ |
38 */ |
39 protected $_filters = array(); |
39 protected $_filters = array(); |
40 |
40 |
41 /** |
41 /** |
42 * Formats the log message before writing. |
42 * Formats the log message before writing. |
|
43 * |
43 * @var Zend_Log_Formatter_Interface |
44 * @var Zend_Log_Formatter_Interface |
44 */ |
45 */ |
45 protected $_formatter; |
46 protected $_formatter; |
46 |
47 |
47 /** |
48 /** |
48 * Add a filter specific to this writer. |
49 * Add a filter specific to this writer. |
49 * |
50 * |
50 * @param Zend_Log_Filter_Interface $filter |
51 * @param Zend_Log_Filter_Interface $filter |
51 * @return void |
52 * @return Zend_Log_Writer_Abstract |
52 */ |
53 */ |
53 public function addFilter($filter) |
54 public function addFilter($filter) |
54 { |
55 { |
55 if (is_integer($filter)) { |
56 if (is_int($filter)) { |
56 $filter = new Zend_Log_Filter_Priority($filter); |
57 $filter = new Zend_Log_Filter_Priority($filter); |
57 } |
58 } |
58 |
59 |
59 if (!$filter instanceof Zend_Log_Filter_Interface) { |
60 if (!$filter instanceof Zend_Log_Filter_Interface) { |
60 /** @see Zend_Log_Exception */ |
61 /** @see Zend_Log_Exception */ |