mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-22 20:04:12 +01:00
* symfony 5.4 (diff dev) * symfony 5.4 (working) * symfony 5.4 (update autoload) * symfony 5.4 (remove swiftmailer mailer implementation) * symfony 5.4 (php doc and split Global accessor class) ### Impacted packages: composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
46 lines
2.1 KiB
PHP
46 lines
2.1 KiB
PHP
<table class="logs" data-filter-level="Emergency,Alert,Critical,Error,Warning,Notice,Info,Debug" data-filters>
|
|
<?php $channelIsDefined = isset($logs[0]['channel']); ?>
|
|
<thead>
|
|
<tr>
|
|
<th data-filter="level">Level</th>
|
|
<?php if ($channelIsDefined) { ?><th data-filter="channel">Channel</th><?php } ?>
|
|
<th class="full-width">Message</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<?php
|
|
foreach ($logs as $log) {
|
|
if ($log['priority'] >= 400) {
|
|
$status = 'error';
|
|
} elseif ($log['priority'] >= 300) {
|
|
$status = 'warning';
|
|
} else {
|
|
$severity = 0;
|
|
if (($exception = $log['context']['exception'] ?? null) instanceof \ErrorException || $exception instanceof \Symfony\Component\ErrorHandler\Exception\SilencedErrorContext) {
|
|
$severity = $exception->getSeverity();
|
|
}
|
|
$status = \E_DEPRECATED === $severity || \E_USER_DEPRECATED === $severity ? 'warning' : 'normal';
|
|
} ?>
|
|
<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>
|