mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-17 02:24:03 +02:00
Fix type error, fixes #1369
This commit is contained in:
@@ -217,7 +217,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
|
|||||||
if (empty($value)) {
|
if (empty($value)) {
|
||||||
$value = static::quote('');
|
$value = static::quote('');
|
||||||
}
|
}
|
||||||
$script[] = static::call('log', static::quote('%s: %o'), static::quote($key), $value);
|
$script[] = static::call('log', static::quote('%s: %o'), static::quote((string) $key), $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $script;
|
return $script;
|
||||||
|
@@ -89,13 +89,14 @@ EOF;
|
|||||||
$handler = new BrowserConsoleHandler();
|
$handler = new BrowserConsoleHandler();
|
||||||
$handler->setFormatter($this->getIdentityFormatter());
|
$handler->setFormatter($this->getIdentityFormatter());
|
||||||
|
|
||||||
$handler->handle($this->getRecord(Logger::DEBUG, 'test', ['foo' => 'bar']));
|
$handler->handle($this->getRecord(Logger::DEBUG, 'test', ['foo' => 'bar', 0 => 'oop']));
|
||||||
|
|
||||||
$expected = <<<EOF
|
$expected = <<<EOF
|
||||||
(function (c) {if (c && c.groupCollapsed) {
|
(function (c) {if (c && c.groupCollapsed) {
|
||||||
c.groupCollapsed("%ctest", "font-weight: normal");
|
c.groupCollapsed("%ctest", "font-weight: normal");
|
||||||
c.log("%c%s", "font-weight: bold", "Context");
|
c.log("%c%s", "font-weight: bold", "Context");
|
||||||
c.log("%s: %o", "foo", "bar");
|
c.log("%s: %o", "foo", "bar");
|
||||||
|
c.log("%s: %o", "0", "oop");
|
||||||
c.groupEnd();
|
c.groupEnd();
|
||||||
}})(console);
|
}})(console);
|
||||||
EOF;
|
EOF;
|
||||||
|
Reference in New Issue
Block a user