本文整理匯總了PHP中Zend_Log::alert方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Log::alert方法的具體用法?PHP Zend_Log::alert怎麽用?PHP Zend_Log::alert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Log
的用法示例。
在下文中一共展示了Zend_Log::alert方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: editAction
public function editAction()
{
$this->view->title = "Edit album";
$form = new Album_Form_Album();
$form->submit->setLabel('Save');
$this->view->form = $form;
if ($this->getRequest()->isPost()) {
$formData = $this->getRequest()->getPost();
if ($form->isValid($formData)) {
$id = (int) $form->getValue('id');
$artist = $form->getValue('artist');
$title = $form->getValue('title');
$albums = new Album_Model_DbTable_Albums();
$albums->updateAlbum($id, $artist, $title);
//Inicializamos el log
$logger = new Zend_Log();
//Aqui ponemos las salida por archivo
$writer = new Zend_Log_Writer_Stream('../log/zfw.log');
$logger->addWriter($writer);
//Aqui indicamos que solo se mostraran los mensajes que sean iguales o superiores al filtro
$filter = new Zend_Log_Filter_Priority(Zend_Log::INFO);
$logger->addFilter($filter);
$logger->alert('actualiza la informacion del title ' . $title);
$this->_helper->redirector('index');
} else {
$form->populate($formData);
}
} else {
$id = $this->_getParam('id', 0);
if ($id > 0) {
$albums = new Album_Model_DbTable_Albums();
$form->populate($albums->getAlbum($id));
}
}
}
示例2: alert
/**
* Prio 1: Alert: action must be taken immediately
*
* @param string $msg
* @param EngineBlock_Log_Message_AdditionalInfo $additionalInfo
* @return void
*/
public function alert($msg, $additionalInfo = null)
{
$this->_setAdditionalEventItems($additionalInfo);
parent::alert($msg);
}
示例3: alert
public static function alert($message)
{
self::$_logger->alert($message);
}