summary.php 883 Bytes
Newer Older
Mark committed
1
<?php
2 3
/* @var $panel yii\debug\panels\LogPanel */
/* @var $data array */
4

Mark committed
5 6
use yii\log\Target;
use yii\log\Logger;
Tobias Munk committed
7

Mark committed
8 9 10 11 12 13 14 15 16
?>

<?php
$title = 'Logged ' . count($data['messages']) . ' messages';
$errorCount = count(Target::filterMessages($data['messages'], Logger::LEVEL_ERROR));
$warningCount = count(Target::filterMessages($data['messages'], Logger::LEVEL_WARNING));
$output = [];

if ($errorCount) {
17 18
    $output[] = "<span class=\"label label-important\">$errorCount</span>";
    $title .= ", $errorCount errors";
Mark committed
19 20 21
}

if ($warningCount) {
22 23
    $output[] = "<span class=\"label label-warning\">$warningCount</span>";
    $title .= ", $warningCount warnings";
Mark committed
24 25 26 27
}
?>

<div class="yii-debug-toolbar-block">
28 29 30 31
    <a href="<?= $panel->getUrl() ?>" title="<?= $title ?>">Log
        <span class="label"><?= count($data['messages']) ?></span>
        <?= implode('&nbsp;', $output) ?>
    </a>
Qiang Xue committed
32
</div>