mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Fix BrowserConsoleHandler formatting
This resolves an issue whereby all styles would be applied in reverse order to the formatting markers.
This commit is contained in:
committed by
Jordi Boggiano
parent
65f1f304d4
commit
0ff3a9bd03
@@ -48,6 +48,22 @@ EOF;
|
||||
$this->assertEquals($expected, $this->generateScript());
|
||||
}
|
||||
|
||||
public function testStylingMultiple()
|
||||
{
|
||||
$handler = new BrowserConsoleHandler();
|
||||
$handler->setFormatter($this->getIdentityFormatter());
|
||||
|
||||
$handler->handle($this->getRecord(Logger::DEBUG, 'foo[[bar]]{color: red}[[baz]]{color: blue}'));
|
||||
|
||||
$expected = <<<EOF
|
||||
(function (c) {if (c && c.groupCollapsed) {
|
||||
c.log("%cfoo%cbar%c%cbaz%c", "font-weight: normal", "color: red", "font-weight: normal", "color: blue", "font-weight: normal");
|
||||
}})(console);
|
||||
EOF;
|
||||
|
||||
$this->assertEquals($expected, $this->generateScript());
|
||||
}
|
||||
|
||||
public function testEscaping()
|
||||
{
|
||||
$handler = new BrowserConsoleHandler();
|
||||
|
Reference in New Issue
Block a user