当前位置: 首页>>代码示例>>PHP>>正文


PHP Console::logError方法代码示例

本文整理汇总了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);
}
开发者ID:patrix,项目名称:oraculum,代码行数:33,代码来源:logs.php

示例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.');
		}
	}
开发者ID:nixonch,项目名称:a2billing,代码行数:15,代码来源:index.php

示例3: wpdt_log_error

 function wpdt_log_error($exception, $message)
 {
     Console::logError($exception, $message);
 }
开发者ID:netconstructor,项目名称:wp-developer-tools,代码行数:4,代码来源:wp-developer-tools.php

示例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;
 }
开发者ID:Jsnrkd,项目名称:Walleye,代码行数:37,代码来源:walleye.php

示例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']);
 }
开发者ID:Jmayhak,项目名称:Walleye,代码行数:13,代码来源:ConsoleTest.php

示例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);
     }
 }
开发者ID:Jmayhak,项目名称:Walleye,代码行数:17,代码来源:walleye.controller.php

示例7: error

 public static function error($exception)
 {
     if (isset(self::$profiler)) {
         Console::logError($exception);
     }
 }
开发者ID:htmlgraphic,项目名称:HTMLgraphic-MVC,代码行数:6,代码来源:Debugger.class.inc.php


注:本文中的Console::logError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。