getFile() . ' line ' . $this->getLine() . "\n"; echo $this->getTraceAsString() . "\n"; } elseif (_PS_MODE_DEV_) { // Display error message echo ''; echo '
';
foreach ($lines as $k => $l) {
$string = ($offset + $k) . '. ' . htmlspecialchars($l);
if ($offset + $k == $line) {
echo '' . $string . '';
} else {
echo $string;
}
}
echo '';
foreach ($args as $arg => $value) {
echo 'Argument [' . Tools::safeOutput($arg) . "]\n";
echo Tools::safeOutput(print_r($value, true));
echo "\n";
}
echo '';
}
/**
* Log the error on the disk.
*/
protected function logError()
{
$logger = new FileLogger();
$logger->setFilename(_PS_ROOT_DIR_ . '/var/logs/' . date('Ymd') . '_exception.log');
try {
$logger->logError($this->getExtendedMessage(false));
} catch (PrestaShopException) {
// Catch exception because there is a hook executed in the AbstractLogger that is bound to fail when the DB
// is not accessible, there is no point adding some potential error in this method that is already logging
// a previous error, it would only confuse the error messages and cause an unwanted fatal error
}
}
/**
* Return the content of the Exception.
*
* @return string content of the exception
*/
protected function getExtendedMessage($html = true)
{
$format = '%s
at line %d in file %s