silverstripe-framework/dev/SSZendLog.php
Sean Harvey 2cca0b0a7b API CHANGE Added SSLogFileWriter to replace Debug::log_errors_to() and Debug::log_error_if_necessary() - the existing formatting for the Debug deprecation functions is now wrapped into SSLogErrorFileFormatter
MINOR Moved SSErrorLogTest to SSLogTest
MINOR Documentation updates for SSLog and other bits and pieces



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84828 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-19 21:55:03 +00:00

44 lines
876 B
PHP

<?php
/**
* Extensions to Zend_Log to make it work nicer
* with {@link SSLog}.
*
* Please refer to {@link SSLog} for information on
* setting up logging for your projects.
*
* @package sapphire
* @subpackage dev
*/
require_once 'Zend/Log.php';
class SSZendLog extends Zend_Log {
/**
* Get all writers in this logger.
* @return array of Zend_Log_Writer_Abstract instances
*/
public function getWriters() {
return $this->_writers;
}
/**
* Remove a writer instance that exists in this logger.
* @param object Zend_Log_Writer_Abstract instance
*/
public function removeWriter($writer) {
foreach($this->_writers as $index => $existingWriter) {
if($existingWriter == $writer) {
unset($this->_writers[$index]);
}
}
}
/**
* Clear all writers in this logger.
*/
public function clearWriters() {
$this->_writers = array();
}
}