mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 12:17:35 +02:00
@@ -208,13 +208,17 @@ class SlackRecord
|
|||||||
{
|
{
|
||||||
$normalized = $this->normalizerFormatter->format($fields);
|
$normalized = $this->normalizerFormatter->format($fields);
|
||||||
$prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
|
$prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
|
||||||
|
$flags = 0;
|
||||||
|
if (PHP_VERSION_ID >= 50400) {
|
||||||
|
$flags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
|
||||||
|
}
|
||||||
|
|
||||||
$hasSecondDimension = count(array_filter($normalized, 'is_array'));
|
$hasSecondDimension = count(array_filter($normalized, 'is_array'));
|
||||||
$hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
|
$hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
|
||||||
|
|
||||||
return $hasSecondDimension || $hasNonNumericKeys
|
return $hasSecondDimension || $hasNonNumericKeys
|
||||||
? Utils::jsonEncode($normalized, $prettyPrintFlag)
|
? Utils::jsonEncode($normalized, $prettyPrintFlag | $flags)
|
||||||
: Utils::jsonEncode($normalized);
|
: Utils::jsonEncode($normalized, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user