/**
  * 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"]|');
 }
 /**
  * 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();
 }
Exemplo n.º 3
0
 /**
  * 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();
 }
 /**
  * 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);
 }
Exemplo n.º 5
0
/**
 * 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();
	}