1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-22 05:52:31 +01:00

Rename ChromePhp to ChromePHP for consistency with FirePHP

This commit is contained in:
Jordi Boggiano 2012-02-20 17:33:29 +01:00
parent 1c717c3a6a
commit 8d4ac5c0f7
7 changed files with 28 additions and 28 deletions

View File

@ -4,7 +4,7 @@
* Added Monolog\Logger::isHandling() to check if a handler will * Added Monolog\Logger::isHandling() to check if a handler will
handle the given log level handle the given log level
* Added ChromePhpHandler * Added ChromePHPHandler
* 1.0.2 (2011-10-24) * 1.0.2 (2011-10-24)

View File

@ -41,7 +41,7 @@ Handlers
- _StreamHandler_: Logs records into any php stream, use this for log files. - _StreamHandler_: Logs records into any php stream, use this for log files.
- _RotatingFileHandler_: Logs records to a file and creates one logfile per day. It will also delete files older than $maxFiles. You should use [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile setups though, this is just meant as a quick and dirty solution. - _RotatingFileHandler_: Logs records to a file and creates one logfile per day. It will also delete files older than $maxFiles. You should use [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile setups though, this is just meant as a quick and dirty solution.
- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing inline `console` messages within [FireBug](http://getfirebug.com/). - _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing inline `console` messages within [FireBug](http://getfirebug.com/).
- _ChromePhpHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing inline `console` messages within Chrome. - _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing inline `console` messages within Chrome.
- _NativeMailHandler_: Sends emails using PHP's mail() function. - _NativeMailHandler_: Sends emails using PHP's mail() function.
- _SwiftMailerHandler_: Sends emails using a SwiftMailer instance. - _SwiftMailerHandler_: Sends emails using a SwiftMailer instance.
- _SyslogHandler_: Logs records to the syslog. - _SyslogHandler_: Logs records to the syslog.
@ -61,7 +61,7 @@ Formatters
- _LineFormatter_: Formats a log record into a one-line string. - _LineFormatter_: Formats a log record into a one-line string.
- _JsonFormatter_: Encodes a log record into json. - _JsonFormatter_: Encodes a log record into json.
- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler. - _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler.
- _ChromePhpFormatter_: Used to format log records into the ChromePhp format, only useful for the ChromePhpHandler. - _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler.
Processors Processors
---------- ----------

View File

@ -14,11 +14,11 @@ namespace Monolog\Formatter;
use Monolog\Logger; use Monolog\Logger;
/** /**
* Formats a log message according to the ChromePhp array format * Formats a log message according to the ChromePHP array format
* *
* @author Christophe Coevoet <stof@notk.org> * @author Christophe Coevoet <stof@notk.org>
*/ */
class ChromePhpFormatter implements FormatterInterface class ChromePHPFormatter implements FormatterInterface
{ {
/** /**
* Translates Monolog log levels to Wildfire levels. * Translates Monolog log levels to Wildfire levels.

View File

@ -12,14 +12,14 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Formatter\ChromePhpFormatter; use Monolog\Formatter\ChromePHPFormatter;
/** /**
* Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
* *
* @author Christophe Coevoet <stof@notk.org> * @author Christophe Coevoet <stof@notk.org>
*/ */
class ChromePhpHandler extends AbstractProcessingHandler class ChromePHPHandler extends AbstractProcessingHandler
{ {
/** /**
* Version of the extension * Version of the extension
@ -67,7 +67,7 @@ class ChromePhpHandler extends AbstractProcessingHandler
*/ */
protected function getDefaultFormatter() protected function getDefaultFormatter()
{ {
return new ChromePhpFormatter(); return new ChromePHPFormatter();
} }
/** /**

View File

@ -13,14 +13,14 @@ namespace Monolog\Formatter;
use Monolog\Logger; use Monolog\Logger;
class ChromePhpFormatterTest extends \PHPUnit_Framework_TestCase class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @covers Monolog\Formatter\ChromePhpFormatter::format * @covers Monolog\Formatter\ChromePHPFormatter::format
*/ */
public function testDefaultFormat() public function testDefaultFormat()
{ {
$formatter = new ChromePhpFormatter(); $formatter = new ChromePHPFormatter();
$record = array( $record = array(
'level' => Logger::ERROR, 'level' => Logger::ERROR,
'level_name' => 'ERROR', 'level_name' => 'ERROR',
@ -49,11 +49,11 @@ class ChromePhpFormatterTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @covers Monolog\Formatter\ChromePhpFormatter::format * @covers Monolog\Formatter\ChromePHPFormatter::format
*/ */
public function testFormatWithFileAndLine() public function testFormatWithFileAndLine()
{ {
$formatter = new ChromePhpFormatter(); $formatter = new ChromePHPFormatter();
$record = array( $record = array(
'level' => Logger::CRITICAL, 'level' => Logger::CRITICAL,
'level_name' => 'CRITICAL', 'level_name' => 'CRITICAL',
@ -82,11 +82,11 @@ class ChromePhpFormatterTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @covers Monolog\Formatter\ChromePhpFormatter::format * @covers Monolog\Formatter\ChromePHPFormatter::format
*/ */
public function testFormatWithoutContext() public function testFormatWithoutContext()
{ {
$formatter = new ChromePhpFormatter(); $formatter = new ChromePHPFormatter();
$record = array( $record = array(
'level' => Logger::DEBUG, 'level' => Logger::DEBUG,
'level_name' => 'DEBUG', 'level_name' => 'DEBUG',
@ -111,11 +111,11 @@ class ChromePhpFormatterTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @covers Monolog\Formatter\ChromePhpFormatter::formatBatch * @covers Monolog\Formatter\ChromePHPFormatter::formatBatch
*/ */
public function testBatchFormatThrowException() public function testBatchFormatThrowException()
{ {
$formatter = new ChromePhpFormatter(); $formatter = new ChromePHPFormatter();
$records = array( $records = array(
array( array(
'level' => Logger::INFO, 'level' => Logger::INFO,

View File

@ -20,11 +20,11 @@ spl_autoload_register(function($class)
use Monolog\Logger; use Monolog\Logger;
use Monolog\Handler\FirePHPHandler; use Monolog\Handler\FirePHPHandler;
use Monolog\Handler\ChromePhpHandler; use Monolog\Handler\ChromePHPHandler;
$logger = new Logger('firephp'); $logger = new Logger('firephp');
$logger->pushHandler(new FirePHPHandler); $logger->pushHandler(new FirePHPHandler);
$logger->pushHandler(new ChromePhpHandler()); $logger->pushHandler(new ChromePHPHandler());
$logger->addDebug('Debug'); $logger->addDebug('Debug');
$logger->addInfo('Info'); $logger->addInfo('Info');

View File

@ -15,25 +15,25 @@ use Monolog\TestCase;
use Monolog\Logger; use Monolog\Logger;
/** /**
* @covers Monolog\Handler\ChromePhpHandler * @covers Monolog\Handler\ChromePHPHandler
*/ */
class ChromePhpHandlerTest extends TestCase class ChromePHPHandlerTest extends TestCase
{ {
protected function setUp() protected function setUp()
{ {
TestChromePhpHandler::reset(); TestChromePHPHandler::reset();
} }
public function testHeaders() public function testHeaders()
{ {
$handler = new TestChromePhpHandler(); $handler = new TestChromePHPHandler();
$handler->setFormatter($this->getIdentityFormatter()); $handler->setFormatter($this->getIdentityFormatter());
$handler->handle($this->getRecord(Logger::DEBUG)); $handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::WARNING)); $handler->handle($this->getRecord(Logger::WARNING));
$expected = array( $expected = array(
'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array( 'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array(
'version' => ChromePhpHandler::VERSION, 'version' => ChromePHPHandler::VERSION,
'columns' => array('label', 'log', 'backtrace', 'type'), 'columns' => array('label', 'log', 'backtrace', 'type'),
'rows' => array( 'rows' => array(
'test', 'test',
@ -48,19 +48,19 @@ class ChromePhpHandlerTest extends TestCase
public function testConcurrentHandlers() public function testConcurrentHandlers()
{ {
$handler = new TestChromePhpHandler(); $handler = new TestChromePHPHandler();
$handler->setFormatter($this->getIdentityFormatter()); $handler->setFormatter($this->getIdentityFormatter());
$handler->handle($this->getRecord(Logger::DEBUG)); $handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::WARNING)); $handler->handle($this->getRecord(Logger::WARNING));
$handler2 = new TestChromePhpHandler(); $handler2 = new TestChromePHPHandler();
$handler2->setFormatter($this->getIdentityFormatter()); $handler2->setFormatter($this->getIdentityFormatter());
$handler2->handle($this->getRecord(Logger::DEBUG)); $handler2->handle($this->getRecord(Logger::DEBUG));
$handler2->handle($this->getRecord(Logger::WARNING)); $handler2->handle($this->getRecord(Logger::WARNING));
$expected = array( $expected = array(
'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array( 'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array(
'version' => ChromePhpHandler::VERSION, 'version' => ChromePHPHandler::VERSION,
'columns' => array('label', 'log', 'backtrace', 'type'), 'columns' => array('label', 'log', 'backtrace', 'type'),
'rows' => array( 'rows' => array(
'test', 'test',
@ -76,7 +76,7 @@ class ChromePhpHandlerTest extends TestCase
} }
} }
class TestChromePhpHandler extends ChromePhpHandler class TestChromePHPHandler extends ChromePHPHandler
{ {
protected $headers = array(); protected $headers = array();