mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 09:06:10 +02:00
Merge branch '1.x'
This commit is contained in:
@@ -130,4 +130,22 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa
|
||||
$this->handler->reset();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setFormatter(FormatterInterface $formatter)
|
||||
{
|
||||
$this->handler->setFormatter($formatter);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFormatter()
|
||||
{
|
||||
return $this->handler->getFormatter();
|
||||
}
|
||||
}
|
||||
|
@@ -217,8 +217,8 @@ class SlackRecord
|
||||
$hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
|
||||
|
||||
return $hasSecondDimension || $hasNonNumericKeys
|
||||
? Utils::jsonEncode($normalized, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE)
|
||||
: Utils::jsonEncode($normalized, JSON_UNESCAPED_UNICODE);
|
||||
? Utils::jsonEncode($normalized, JSON_PRETTY_PRINT|Utils::DEFAULT_JSON_FLAGS)
|
||||
: Utils::jsonEncode($normalized, Utils::DEFAULT_JSON_FLAGS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -49,13 +49,17 @@ final class Utils
|
||||
$encodeFlags = self::DEFAULT_JSON_FLAGS;
|
||||
}
|
||||
|
||||
$json = json_encode($data, $encodeFlags);
|
||||
|
||||
if (false === $json) {
|
||||
if ($ignoreErrors) {
|
||||
if ($ignoreErrors) {
|
||||
$json = @json_encode($data, $encodeFlags);
|
||||
if (false === $json) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
$json = json_encode($data, $encodeFlags);
|
||||
if (false === $json) {
|
||||
$json = self::handleJsonError(json_last_error(), $data);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user