mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 19:57:41 +02:00
@@ -208,13 +208,17 @@ class SlackRecord
|
||||
{
|
||||
$normalized = $this->normalizerFormatter->format($fields);
|
||||
$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'));
|
||||
$hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
|
||||
|
||||
return $hasSecondDimension || $hasNonNumericKeys
|
||||
? Utils::jsonEncode($normalized, $prettyPrintFlag)
|
||||
: Utils::jsonEncode($normalized);
|
||||
? Utils::jsonEncode($normalized, $prettyPrintFlag | $flags)
|
||||
: Utils::jsonEncode($normalized, $flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user