You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 line
979B

  1. <?php
  2. /* @var $panel yii\debug\panels\LogPanel */
  3. /* @var $data array */
  4. use yii\log\Target;
  5. use yii\log\Logger;
  6. ?>
  7. <?php
  8. $title = 'Logged ' . count($data['messages']) . ' messages';
  9. $errorCount = count(Target::filterMessages($data['messages'], Logger::LEVEL_ERROR));
  10. $warningCount = count(Target::filterMessages($data['messages'], Logger::LEVEL_WARNING));
  11. $output = [];
  12. if ($errorCount) {
  13. $output[] = "<span class=\"yii-debug-toolbar__label yii-debug-toolbar__label_important\">$errorCount</span>";
  14. $title .= ", $errorCount errors";
  15. }
  16. if ($warningCount) {
  17. $output[] = "<span class=\"yii-debug-toolbar__label yii-debug-toolbar__label_warning\">$warningCount</span>";
  18. $title .= ", $warningCount warnings";
  19. }
  20. ?>
  21. <div class="yii-debug-toolbar__block">
  22. <a href="<?= $panel->getUrl() ?>" title="<?= $title ?>">Log
  23. <span class="yii-debug-toolbar__label"><?= count($data['messages']) ?></span>
  24. <?= implode('&nbsp;', $output) ?>
  25. </a>
  26. </div>