本文整理汇总了PHP中Console::logError方法的典型用法代码示例。如果您正苦于以下问题:PHP Console::logError方法的具体用法?PHP Console::logError怎么用?PHP Console::logError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Console
的用法示例。
在下文中一共展示了Console::logError方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gravalog
function gravalog($numero, $texto, $pagina = null, $linha = null, $contexto = null)
{
$ddf = fopen(DIR_LOGS . "/" . date('Y.M.d') . ".log", 'a');
if ($ddf) {
$datalog = date('d.m.Y H:i:s');
$txt = "::[" . $datalog . "]--|" . ip() . "|----------------------\n";
$txt .= "(" . $numero . ") " . $texto . "\n";
if (!is_null($pagina)) {
$txt .= "Pagina: " . $pagina . "\n";
}
if (!is_null($linha)) {
$txt .= "Linha: " . $linha . "\n";
}
$txt .= "\n";
if (PROFILER) {
if (class_exists("Console")) {
$e = new ErrorException($texto, 0, $numero, $pagina, $linha);
Console::logError($e, $texto);
}
}
if (fwrite($ddf, $txt)) {
return true;
if (DEBUG) {
alert('Arquivo gravado com sucesso', false);
}
}
} else {
if (DEBUG) {
alert('Erro ao gravar arquivo', false);
}
}
fclose($ddf);
}
示例2: sampleConsoleData
public function sampleConsoleData() {
try {
Console::log('Begin logging data');
Console::logMemory($this, 'PQP Example Class : Line '.__LINE__);
Console::logSpeed('Time taken to get to line '.__LINE__);
Console::log(array('Name' => 'Ryan', 'Last' => 'Campbell'));
Console::logSpeed('Time taken to get to line '.__LINE__);
Console::logMemory($this, 'PQP Example Class : Line '.__LINE__);
Console::log('Ending log below with a sample error.');
throw new Exception('Unable to write to log!');
}
catch(Exception $e) {
Console::logError($e, 'Sample error logging.');
}
}
示例3: wpdt_log_error
function wpdt_log_error($exception, $message)
{
Console::logError($exception, $message);
}
示例4: setLogsFromData
/**
* Any logs sent in the GET request will be removed from the data property and added through the Console class.
* The returned array will be all original key/value pairs minus logs
*
* @param array $data
* @return array
*/
private function setLogsFromData($data)
{
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
foreach ($data as $key => $value) {
if ($key == 'logs' && is_array($value)) {
foreach ($value as $key => $log) {
if (isset($log['type']) && isset($log['message']) && isset($log['file']) && isset($log['line'])) {
switch ($log['type']) {
case Console::ALERT:
Console::alert($log['message']);
unset($data[$key]);
break;
case Console::LOG:
Console::log($log['message'], $log['file'], $log['line']);
unset($data[$key]);
break;
case Console::ERROR:
Console::logError($log['message'], $log['file'], $log['line']);
unset($data[$key]);
break;
default:
break;
}
}
}
}
}
}
return $data;
}
示例5: testLogErrorInsertedToDatabase
/**
*
*/
public function testLogErrorInsertedToDatabase()
{
$db = new Database();
$get_logcount_stmt = $db->prepare('SELECT count(id) AS num_logs FROM Logs');
$get_logcount_stmt->execute();
$row = $db->getRow($get_logcount_stmt);
Console::logError('test', 'file.php', '111');
$logs = Console::getLogs();
$this->assertEquals($row->num_logs + 1, $logs[0]['id']);
}
示例6: addJS
/**
* Use this function to add javascript to the views
*
* Just pass the location from httpdocs/js/
*
* @param string $loc
*/
protected final function addJS($loc)
{
if (file_exists($script = Walleye::getInstance()->getServerBaseDir() . 'httpdocs/js/' . $loc)) {
$scripts = $this->values['js'];
$scripts[] = $script;
$this->values['js'] = $scripts;
} else {
Console::logError('Passed a javascript that cannot be found: ' . $loc);
}
}
示例7: error
public static function error($exception)
{
if (isset(self::$profiler)) {
Console::logError($exception);
}
}