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

Mark committed
7 8
use yii\log\Target;
use yii\log\Logger;
Tobias Munk committed
9

Mark committed
10 11 12 13 14 15 16 17 18
?>

<?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) {
19 20
    $output[] = "<span class=\"label label-important\">$errorCount</span>";
    $title .= ", $errorCount errors";
Mark committed
21 22 23
}

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

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