Skip to content

Commit

Permalink
bar: errors panel => warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 7, 2024
1 parent a810430 commit 56fa4fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (empty($data)) {
}
?>
<style class="tracy-debug">
#tracy-debug .tracy-ErrorTab {
#tracy-debug .tracy-WarningsTab {
display: block;
background: #D51616;
color: white;
Expand All @@ -19,7 +19,7 @@ if (empty($data)) {
padding: 1px .4em;
}
</style>
<span class="tracy-ErrorTab">
<span class="tracy-WarningsTab">
<svg viewBox="0 0 2048 2048"><path fill="#fff" d="M1152 1503v-190q0-14-9.5-23.5t-22.5-9.5h-192q-13 0-22.5 9.5t-9.5 23.5v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11h-220q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17h-1536q-34 0-63.5-17t-46.5-46q-37-63-2-126l768-1408q17-31 47-49t65-18 65 18 47 49z"/>
</svg><span class="tracy-label"><?= $sum = array_sum($data), $sum > 1 ? ' warnings' : ' warning' ?></span>
</span>
2 changes: 1 addition & 1 deletion src/Tracy/Debugger/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public static function getBar(): Bar
self::$bar = new Bar;
self::$bar->addPanel($info = new DefaultBarPanel('info'), 'Tracy:info');
$info->cpuUsage = self::$cpuUsage;
self::$bar->addPanel(new DefaultBarPanel('errors'), 'Tracy:errors'); // filled by errorHandler()
self::$bar->addPanel(new DefaultBarPanel('warnings'), 'Tracy:warnings'); // filled by errorHandler()
}

return self::$bar;
Expand Down
2 changes: 1 addition & 1 deletion src/Tracy/Debugger/DevelopmentStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function handleError(
}

$message = Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message);
$count = &$this->bar->getPanel('Tracy:errors')->data["$file|$line|$message"];
$count = &$this->bar->getPanel('Tracy:warnings')->data["$file|$line|$message"];

if (!$count++ && !Helpers::isHtmlMode() && !Helpers::isAjax()) {
echo "\n$message in $file on line $line\n";
Expand Down

0 comments on commit 56fa4fa

Please sign in to comment.