Ejemplo n.º 1
0
 /**
  * Make sure if we enable logging that the IfwPsn_Vendor_Zend_Log class
  * is available.
  * Create a default log object if none is set.
  *
  * @throws IfwPsn_Vendor_Zend_Cache_Exception
  * @return void
  */
 protected function _loggerSanity()
 {
     if (!isset($this->_options['logging']) || !$this->_options['logging']) {
         return;
     }
     if (isset($this->_options['logger']) && $this->_options['logger'] instanceof IfwPsn_Vendor_Zend_Log) {
         return;
     }
     // Create a default logger to the standard output stream
     require_once IFW_PSN_LIB_ROOT . 'IfwPsn/Vendor/Zend/Log.php';
     require_once IFW_PSN_LIB_ROOT . 'IfwPsn/Vendor/Zend/Log/Writer/Stream.php';
     require_once IFW_PSN_LIB_ROOT . 'IfwPsn/Vendor/Zend/Log/Filter/Priority.php';
     $logger = new IfwPsn_Vendor_Zend_Log(new IfwPsn_Vendor_Zend_Log_Writer_Stream('php://output'));
     $logger->addFilter(new IfwPsn_Vendor_Zend_Log_Filter_Priority(IfwPsn_Vendor_Zend_Log::WARN, '<='));
     $this->_options['logger'] = $logger;
 }