本文整理汇总了PHP中Zend_Log::table方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Log::table方法的具体用法?PHP Zend_Log::table怎么用?PHP Zend_Log::table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Log
的用法示例。
在下文中一共展示了Zend_Log::table方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
$logger->addPriority('LOGD', 8);
$writer->setPriorityStyle(8, 'LOG');
$logger->addPriority('ERROR', 9);
$writer->setPriorityStyle(9, 'ERROR');
$logger->addPriority('TRACE', 10);
$writer->setPriorityStyle(10, 'TRACE');
$logger->addPriority('EXCEPTION', 11);
$writer->setPriorityStyle(11, 'EXCEPTION');
$logger->addPriority('TABLE', 12);
$writer->setPriorityStyle(12, 'TABLE');
$logger->logd($_SERVER);
$logger->info($_SERVER);
$logger->warn($_SERVER);
$logger->error($_SERVER);
$logger->trace($_SERVER);
try {
throw new Exception('Test Exception');
} catch (Exception $e) {
$logger->exception($e);
}
$logger->table(array('2 SQL queries took 0.06 seconds', array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2')))));
}
示例2: dirname
<?php
define('ZF_APPLICATION_DIRECTORY', dirname(dirname(dirname(__FILE__))));
define('ZF_LIBRARY_DIRECTORY', dirname(ZF_APPLICATION_DIRECTORY) . '/library');
set_include_path(ZF_LIBRARY_DIRECTORY);
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
$request = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
$channel->setRequest($request);
$channel->setResponse($response);
$writer = new Zend_Log_Writer_Firebug();
$writer->setPriorityStyle(8, 'TABLE');
$logger = new Zend_Log($writer);
$logger->addPriority('TABLE', 8);
$db = Zend_Db::factory('PDO_SQLITE', array('dbname' => ':memory:'));
$profiler = new Zend_Db_Profiler_Firebug('Queries');
$profiler->setEnabled(true);
$db->setProfiler($profiler);
$db->getConnection()->exec('CREATE TABLE foo (
id INTEGNER NOT NULL,
col1 VARCHAR(10) NOT NULL
)');
$table = array('sdfsdf', array(array('sdfsdf', 'sdfsdf'), array('sdwt32g2', '23g23g')));
$logger->table($table);
$channel->flush();
$channel->getResponse()->sendHeaders();