本文整理汇总了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();
}