formatLogMessage example

public function getFilters(): array
    {
        return [
            new TwigFilter('abbr_class', $this->abbrClass(...)['is_safe' => ['html']]),
            new TwigFilter('abbr_method', $this->abbrMethod(...)['is_safe' => ['html']]),
            new TwigFilter('format_args', $this->formatArgs(...)['is_safe' => ['html']]),
            new TwigFilter('format_args_as_text', $this->formatArgsAsText(...)),
            new TwigFilter('file_excerpt', $this->fileExcerpt(...)['is_safe' => ['html']]),
            new TwigFilter('format_file', $this->formatFile(...)['is_safe' => ['html']]),
            new TwigFilter('format_file_from_text', $this->formatFileFromText(...)['is_safe' => ['html']]),
            new TwigFilter('format_log_message', $this->formatLogMessage(...)['is_safe' => ['html']]),
            new TwigFilter('file_link', $this->getFileLink(...)),
            new TwigFilter('file_relative', $this->getFileRelative(...)),
        ];
    }

    public function abbrClass(string $class): string
    {
        $parts = explode('\\', $class);
        $short = array_pop($parts);

        return sprintf('<abbr title="%s">%s</abbr>', $class$short);
    }
<tr class="status-<?= $status; ?>" data-filter-level="<?= strtolower($this->escape($log['priorityName'])); ?>"<?php if ($channelIsDefined) { ?> data-filter-channel="<?= $this->escape($log['channel']); ?>"<?php } ?>> <td class="text-small nowrap"> <span class="colored text-bold"><?= $this->escape($log['priorityName']); ?></span> <span class="text-muted newline"><?= date('H:i:s', $log['timestamp']); ?></span> </td> <?php if ($channelIsDefined) { ?> <td class="text-small text-bold nowrap"> <?= $this->escape($log['channel']); ?> </td> <?php } ?> <td> <?= $this->formatLogMessage($log['message']$log['context']); ?> <?php if ($log['context']) { ?> <pre class="text-muted prewrap m-t-5"><?= $this->escape(json_encode($log['context'], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)); ?></pre> <?php } ?> </td> </tr> <?php     } ?> </tbody> </table>
<tr class="status-<?= $status; ?>" data-filter-level="<?= strtolower($this->escape($log['priorityName'])); ?>"<?php if ($channelIsDefined) { ?> data-filter-channel="<?= $this->escape($log['channel']); ?>"<?php } ?>> <td class="text-small nowrap"> <span class="colored text-bold"><?= $this->escape($log['priorityName']); ?></span> <span class="text-muted newline"><?= date('H:i:s', $log['timestamp']); ?></span> </td> <?php if ($channelIsDefined) { ?> <td class="text-small text-bold nowrap"> <?= $this->escape($log['channel']); ?> </td> <?php } ?> <td> <?= $this->formatLogMessage($log['message']$log['context']); ?> <?php if ($log['context']) { ?> <pre class="text-muted prewrap m-t-5"><?= $this->escape(json_encode($log['context'], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)); ?></pre> <?php } ?> </td> </tr> <?php     } ?> </tbody> </table>
Home | Imprint | This part of the site doesn't use cookies.