VarDumperWatchdog.php in VarDumper 8
File
modules/vardumper_watchdog/src/VarDumper/VarDumperWatchdog.php
View source
<?php
namespace Drupal\vardumper_watchdog\VarDumper;
use Drupal\vardumper\VarDumper\VarDumperDebug;
class VarDumperWatchdog extends VarDumperDebug {
public function dump($var, $name = '') {
$html = $this
->getHeaders($name, $this
->getDebugInformation()) . $this
->getDebug($var);
if (\Drupal::moduleHandler()
->moduleExists('locale') && ($length = mb_strlen($html) >= 64000)) {
\Drupal::logger('vardumper_watchdog')
->debug('Cannot log objects longer than 64Kb if Locale module is enabled. Currents size is @size. See <a href=https://www.drupal.org/project/drup al/issues/1885192>https://www.drupal.org/project/drupal/issues/1885192</a>. @excerpt...', [
'@size' => $length,
'@excerpt' => mb_substr(strip_tags($html), 0, 256),
]);
}
else {
\Drupal::logger('vardumper_watchdog')
->debug($html);
}
}
}