1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-23 09:36:11 +02:00

use mb_* when needed

This commit is contained in:
vershinin_so
2019-07-08 18:04:33 +03:00
parent ecd871b624
commit f8de7cf628
19 changed files with 42 additions and 64 deletions

View File

@@ -94,7 +94,7 @@ class GelfMessageFormatter extends NormalizerFormatter
->setLevel($this->logLevels[$record['level']]);
// message length + system name length + 200 for padding / metadata
$len = 200 + Utils::strlen((string) $record['message']) + Utils::strlen($this->systemName);
$len = 200 + strlen((string) $record['message']) + strlen($this->systemName);
if ($len > $this->maxLength) {
$message->setShortMessage(Utils::substr($record['message'], 0, $this->maxLength));
@@ -114,7 +114,7 @@ class GelfMessageFormatter extends NormalizerFormatter
foreach ($record['extra'] as $key => $val) {
$val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
$len = Utils::strlen($this->extraPrefix . $key . $val);
$len = strlen($this->extraPrefix . $key . $val);
if ($len > $this->maxLength) {
$message->setAdditional($this->extraPrefix . $key, Utils::substr($val, 0, $this->maxLength));
@@ -125,7 +125,7 @@ class GelfMessageFormatter extends NormalizerFormatter
foreach ($record['context'] as $key => $val) {
$val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
$len = Utils::strlen($this->contextPrefix . $key . $val);
$len = strlen($this->contextPrefix . $key . $val);
if ($len > $this->maxLength) {
$message->setAdditional($this->contextPrefix . $key, Utils::substr($val, 0, $this->maxLength));