本文整理匯總了PHP中FireCake::log方法的典型用法代碼示例。如果您正苦於以下問題:PHP FireCake::log方法的具體用法?PHP FireCake::log怎麽用?PHP FireCake::log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FireCake
的用法示例。
在下文中一共展示了FireCake::log方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testLog
/**
* test Log()
*
* @return void
*/
public function testLog()
{
FireCake::setOptions(array('includeLineNumbers' => false));
FireCake::log('Testing');
$this->assertTrue(isset($this->firecake->sentHeaders['X-Wf-Protocol-1']));
$this->assertTrue(isset($this->firecake->sentHeaders['X-Wf-1-Plugin-1']));
$this->assertTrue(isset($this->firecake->sentHeaders['X-Wf-1-Structure-1']));
$this->assertEqual($this->firecake->sentHeaders['X-Wf-1-Index'], 1);
$this->assertEqual($this->firecake->sentHeaders['X-Wf-1-1-1-1'], '26|[{"Type":"LOG"},"Testing"]|');
FireCake::log('Testing', 'log-info');
$this->assertEqual($this->firecake->sentHeaders['X-Wf-1-1-1-2'], '45|[{"Type":"LOG","Label":"log-info"},"Testing"]|');
}
示例2: _fireError
/**
* Create a FirePHP error message
*
* @param string $error Name of error
* @param string $code Code of error
* @param string $description Description of error
* @param string $file File error occured in
* @param string $line Line error occured on
* @param string $trace Stack trace at time of error
* @param string $context context of error
* @return void
* @access protected
*/
function _fireError($error, $code, $description, $file, $line, $trace, $context)
{
$name = $error . ' - ' . $description;
$message = "{$error} {$code} {$description} on line: {$line} in file: {$file}";
FireCake::group($name);
FireCake::error($message, $name);
FireCake::log($context, 'Context');
FireCake::log($trace, 'Trace');
FireCake::groupEnd();
}
示例3: fireError
/**
* Create a FirePHP error message
*
* @param array $data Data of the error
* @param array $links Links for the error
* @return void
*/
public static function fireError($data, $links)
{
$name = $data['error'] . ' - ' . $data['description'];
$message = "{$data['error']} {$data['code']} {$data['description']} on line: {$data['line']} in file: {$data['file']}";
FireCake::group($name);
FireCake::error($message, $name);
if (isset($data['context'])) {
FireCake::log($data['context'], 'Context');
}
if (isset($data['trace'])) {
FireCake::log($data['trace'], 'Trace');
}
FireCake::groupEnd();
}
示例4: message
/**
* Create a simple message
*
* @param string $label Label of message
* @param string $message Message content
* @return void
*/
public function message($label, $message)
{
FireCake::log($message, $label);
}
示例5: _fireError
/**
* Create a FirePHP error message
*
* @param string $error Name of error
* @param string $code Code of error
* @param string $description Description of error
* @param string $file File error occured in
* @param string $line Line error occured on
* @param string $trace Stack trace at time of error
* @param string $context context of error
* @return void
*/
protected function _fireError($error, $code, $description, $file, $line, $trace, $context) {
$name = $error . ' - ' . $description;
$message = "$error $code $description on line: $line in file: $file";
FireCake::group($name);
FireCake::error($message, $name);
FireCake::log($context, 'Context');
FireCake::log($trace, 'Trace');
FireCake::groupEnd();
}