mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-21 13:33:52 +01:00
Rename ChromePhp to ChromePHP for consistency with FirePHP
This commit is contained in:
parent
1c717c3a6a
commit
8d4ac5c0f7
@ -4,7 +4,7 @@
|
||||
|
||||
* Added Monolog\Logger::isHandling() to check if a handler will
|
||||
handle the given log level
|
||||
* Added ChromePhpHandler
|
||||
* Added ChromePHPHandler
|
||||
|
||||
* 1.0.2 (2011-10-24)
|
||||
|
||||
|
@ -41,7 +41,7 @@ Handlers
|
||||
- _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.
|
||||
- _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.
|
||||
- _SwiftMailerHandler_: Sends emails using a SwiftMailer instance.
|
||||
- _SyslogHandler_: Logs records to the syslog.
|
||||
@ -61,7 +61,7 @@ Formatters
|
||||
- _LineFormatter_: Formats a log record into a one-line string.
|
||||
- _JsonFormatter_: Encodes a log record into json.
|
||||
- _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
|
||||
----------
|
||||
|
@ -14,11 +14,11 @@ namespace Monolog\Formatter;
|
||||
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>
|
||||
*/
|
||||
class ChromePhpFormatter implements FormatterInterface
|
||||
class ChromePHPFormatter implements FormatterInterface
|
||||
{
|
||||
/**
|
||||
* Translates Monolog log levels to Wildfire levels.
|
@ -12,14 +12,14 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Formatter\ChromePhpFormatter;
|
||||
use Monolog\Formatter\ChromePHPFormatter;
|
||||
|
||||
/**
|
||||
* Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
|
||||
*
|
||||
* @author Christophe Coevoet <stof@notk.org>
|
||||
*/
|
||||
class ChromePhpHandler extends AbstractProcessingHandler
|
||||
class ChromePHPHandler extends AbstractProcessingHandler
|
||||
{
|
||||
/**
|
||||
* Version of the extension
|
||||
@ -67,7 +67,7 @@ class ChromePhpHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function getDefaultFormatter()
|
||||
{
|
||||
return new ChromePhpFormatter();
|
||||
return new ChromePHPFormatter();
|
||||
}
|
||||
|
||||
/**
|
@ -13,14 +13,14 @@ namespace Monolog\Formatter;
|
||||
|
||||
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()
|
||||
{
|
||||
$formatter = new ChromePhpFormatter();
|
||||
$formatter = new ChromePHPFormatter();
|
||||
$record = array(
|
||||
'level' => Logger::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()
|
||||
{
|
||||
$formatter = new ChromePhpFormatter();
|
||||
$formatter = new ChromePHPFormatter();
|
||||
$record = array(
|
||||
'level' => Logger::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()
|
||||
{
|
||||
$formatter = new ChromePhpFormatter();
|
||||
$formatter = new ChromePHPFormatter();
|
||||
$record = array(
|
||||
'level' => Logger::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()
|
||||
{
|
||||
$formatter = new ChromePhpFormatter();
|
||||
$formatter = new ChromePHPFormatter();
|
||||
$records = array(
|
||||
array(
|
||||
'level' => Logger::INFO,
|
@ -20,11 +20,11 @@ spl_autoload_register(function($class)
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\FirePHPHandler;
|
||||
use Monolog\Handler\ChromePhpHandler;
|
||||
use Monolog\Handler\ChromePHPHandler;
|
||||
|
||||
$logger = new Logger('firephp');
|
||||
$logger->pushHandler(new FirePHPHandler);
|
||||
$logger->pushHandler(new ChromePhpHandler());
|
||||
$logger->pushHandler(new ChromePHPHandler());
|
||||
|
||||
$logger->addDebug('Debug');
|
||||
$logger->addInfo('Info');
|
||||
|
@ -15,25 +15,25 @@ use Monolog\TestCase;
|
||||
use Monolog\Logger;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\ChromePhpHandler
|
||||
* @covers Monolog\Handler\ChromePHPHandler
|
||||
*/
|
||||
class ChromePhpHandlerTest extends TestCase
|
||||
class ChromePHPHandlerTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
TestChromePhpHandler::reset();
|
||||
TestChromePHPHandler::reset();
|
||||
}
|
||||
|
||||
public function testHeaders()
|
||||
{
|
||||
$handler = new TestChromePhpHandler();
|
||||
$handler = new TestChromePHPHandler();
|
||||
$handler->setFormatter($this->getIdentityFormatter());
|
||||
$handler->handle($this->getRecord(Logger::DEBUG));
|
||||
$handler->handle($this->getRecord(Logger::WARNING));
|
||||
|
||||
$expected = array(
|
||||
'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array(
|
||||
'version' => ChromePhpHandler::VERSION,
|
||||
'version' => ChromePHPHandler::VERSION,
|
||||
'columns' => array('label', 'log', 'backtrace', 'type'),
|
||||
'rows' => array(
|
||||
'test',
|
||||
@ -48,19 +48,19 @@ class ChromePhpHandlerTest extends TestCase
|
||||
|
||||
public function testConcurrentHandlers()
|
||||
{
|
||||
$handler = new TestChromePhpHandler();
|
||||
$handler = new TestChromePHPHandler();
|
||||
$handler->setFormatter($this->getIdentityFormatter());
|
||||
$handler->handle($this->getRecord(Logger::DEBUG));
|
||||
$handler->handle($this->getRecord(Logger::WARNING));
|
||||
|
||||
$handler2 = new TestChromePhpHandler();
|
||||
$handler2 = new TestChromePHPHandler();
|
||||
$handler2->setFormatter($this->getIdentityFormatter());
|
||||
$handler2->handle($this->getRecord(Logger::DEBUG));
|
||||
$handler2->handle($this->getRecord(Logger::WARNING));
|
||||
|
||||
$expected = array(
|
||||
'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array(
|
||||
'version' => ChromePhpHandler::VERSION,
|
||||
'version' => ChromePHPHandler::VERSION,
|
||||
'columns' => array('label', 'log', 'backtrace', 'type'),
|
||||
'rows' => array(
|
||||
'test',
|
||||
@ -76,7 +76,7 @@ class ChromePhpHandlerTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
class TestChromePhpHandler extends ChromePhpHandler
|
||||
class TestChromePHPHandler extends ChromePHPHandler
|
||||
{
|
||||
protected $headers = array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user