namespace Drupal\dblog\Logger;
-use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\DatabaseException;
// Remove any backtraces since they may contain an unserializable variable.
unset($context['backtrace']);
- // Convert PSR3-style messages to SafeMarkup::format() style, so they can be
- // translated too in runtime.
+ // Convert PSR3-style messages to \Drupal\Component\Render\FormattableMarkup
+ // style, so they can be translated too in runtime.
$message_placeholders = $this->parser->parseMessagePlaceholders($message, $context);
try {
->insert('watchdog')
->fields([
'uid' => $context['uid'],
- 'type' => Unicode::substr($context['channel'], 0, 64),
+ 'type' => mb_substr($context['channel'], 0, 64),
'message' => $message,
'variables' => serialize($message_placeholders),
'severity' => $level,
'link' => $context['link'],
'location' => $context['request_uri'],
'referer' => $context['referer'],
- 'hostname' => Unicode::substr($context['ip'], 0, 128),
+ 'hostname' => mb_substr($context['ip'], 0, 128),
'timestamp' => $context['timestamp'],
])
->execute();