1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-19 11:21:27 +02:00

Output message to the user when chrome logs have been truncated, refs #172

This commit is contained in:
Jordi Boggiano
2013-04-23 12:05:59 +02:00
parent 6275edbe75
commit 41d514114c
2 changed files with 43 additions and 4 deletions

View File

@@ -51,13 +51,39 @@ class ChromePHPHandlerTest extends TestCase
$handler = new TestChromePHPHandler();
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 150*1024)));
$headersBefore = $handler->getHeaders();
// overflow chrome headers limit
$handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 100*1024)));
// check the headers did not change
$this->assertEquals($headersBefore, $handler->getHeaders());
$expected = array(
'X-ChromePhp-Data' => base64_encode(utf8_encode(json_encode(array(
'version' => ChromePHPHandler::VERSION,
'columns' => array('label', 'log', 'backtrace', 'type'),
'rows' => array(
array(
'test',
'test',
'unknown',
'log',
),
array(
'test',
str_repeat('a', 150*1024),
'unknown',
'warn',
),
array(
'monolog',
'Incomplete logs, chrome header size limit reached',
'unknown',
'warn',
),
),
'request_uri' => '',
))))
);
$this->assertEquals($expected, $handler->getHeaders());
}
public function testConcurrentHandlers()