1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 20:57:36 +02:00

Merge pull request #20 from stof/firephp

FirePHP Cleanups
This commit is contained in:
Jordi Boggiano
2011-05-06 10:58:18 -07:00
4 changed files with 6 additions and 26 deletions

View File

@@ -34,8 +34,8 @@ class LineFormatter implements FormatterInterface
*/ */
public function __construct($format = null, $dateFormat = null) public function __construct($format = null, $dateFormat = null)
{ {
$this->format = $format ?: self::SIMPLE_FORMAT; $this->format = $format ?: static::SIMPLE_FORMAT;
$this->dateFormat = $dateFormat ?: self::SIMPLE_DATE; $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE;
} }
/** /**

View File

@@ -40,16 +40,7 @@ class WildfireFormatter extends LineFormatter implements FormatterInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function __construct($format = null, $dateFormat = null) public function format(array $record)
{
$this->format = $format ?: self::SIMPLE_FORMAT;
$this->dateFormat = $dateFormat ?: self::SIMPLE_DATE;
}
/**
* {@inheritdoc}
*/
public function format(Array $record)
{ {
// Format record according with LineFormatter // Format record according with LineFormatter
$formatted = parent::format($record); $formatted = parent::format($record);

View File

@@ -52,22 +52,12 @@ class FirePHPHandler extends AbstractHandler
*/ */
protected static $messageIndex = 1; protected static $messageIndex = 1;
/**
* @param integer $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
*/
public function __construct($level = Logger::DEBUG, $bubble = false)
{
$this->level = $level;
$this->bubble = $bubble;
}
/** /**
* Base header creation function used by init headers & record headers * Base header creation function used by init headers & record headers
* *
* @param array $meta Wildfire Plugin, Protocol & Structure Indexes * @param array $meta Wildfire Plugin, Protocol & Structure Indexes
* @param string $message Log message * @param string $message Log message
* @return string Complete header string ready for the client * @return array Complete header string ready for the client as key and message as value
*/ */
protected function createHeader(array $meta, $message) protected function createHeader(array $meta, $message)
{ {
@@ -81,6 +71,7 @@ class FirePHPHandler extends AbstractHandler
* *
* @see createHeader() * @see createHeader()
* @param array $record * @param array $record
* @return string
*/ */
protected function createRecordHeader(array $record) protected function createRecordHeader(array $record)
{ {
@@ -102,7 +93,7 @@ class FirePHPHandler extends AbstractHandler
* *
* @see createHeader() * @see createHeader()
* @see sendHeader() * @see sendHeader()
* @return Array * @return array
*/ */
protected function getInitHeaders() protected function getInitHeaders()
{ {

View File

@@ -15,7 +15,6 @@ use Monolog\Logger;
class WildfireFormatterTest extends \PHPUnit_Framework_TestCase class WildfireFormatterTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @dataProvider recordProvider * @dataProvider recordProvider
*/ */
@@ -46,5 +45,4 @@ class WildfireFormatterTest extends \PHPUnit_Framework_TestCase
array($record), array($record),
); );
} }
} }