summary.php 815 Bytes
Newer Older
Mark committed
1 2 3
<?php
use yii\log\Target;
use yii\log\Logger;
Tobias Munk committed
4

Mark committed
5 6 7 8 9 10 11 12 13
?>

<?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) {
14 15
    $output[] = "<span class=\"label label-important\">$errorCount</span>";
    $title .= ", $errorCount errors";
Mark committed
16 17 18
}

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

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