8000 feature #27170 Show the deprecations tab by default in the logger pan… · symfony/symfony@7943f70 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7943f70

Browse files
committed
feature #27170 Show the deprecations tab by default in the logger panel (javiereguiluz)
This PR was merged into the 4.1-dev branch. Discussion ---------- Show the deprecations tab by default in the logger panel | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Similar to #26398, I propose to display the deprecation tab by default when there are no error logs but there are some deprecations. Commits ------- d27b158 Show the deprecations tab by default in the logger panel
2 parents bad5680 + d27b158 commit 7943f70

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
{% else %}
5454
{# sort collected logs in groups #}
5555
{% set deprecation_logs, debug_logs, info_and_error_logs, silenced_logs = [], [], [], [] %}
56+
{% set has_error_logs = false %}
5657
{% for log in collector.logs %}
5758
{% if log.scream is defined and not log.scream %}
5859
{% set deprecation_logs = deprecation_logs|merge([log]) %}
@@ -62,11 +63,14 @@
6263
{% set debug_logs = debug_logs|merge([log]) %}
6364
{% else %}
6465
{% set info_and_error_logs = info_and_error_logs|merge([log]) %}
66+
{% if log.priorityName != 'INFO' %}
67+
{% set has_error_logs = true %}
68+
{% endif %}
6569
{% endif %}
6670
{% endfor %}
6771

6872
<div class="sf-tabs">
69-
<div class="tab">
73+
<div class="tab {{ has_error_logs ? 'active' }}">
7074
<h3 class="tab-title">Info. &amp; Errors <span class="badge status-{{ collector.counterrors ? 'error' : collector.countwarnings ? 'warning' }}">{{ collector.counterrors ?: info_and_error_logs|length }}</span></h3>
7175
<p class="text-muted">Informational and error log messages generated during the execution of the application.</p>
7276

@@ -81,7 +85,7 @@
8185
</div>
8286
</div>
8387

84-
<div class="tab">
88+
<div class="tab {{ not has_error_logs and collector.countdeprecations > 0 ? 'active' }}">
8589
{# 'deprecation_logs|length' is not used because deprecations are
8690
now grouped and the group count doesn't match the message count #}
8791
<h3 class="tab-title">Deprecations <span class="badge status-{{ collector.countdeprecations ? 'warning' }}">{{ collector.countdeprecations|default(0) }}</span></h3>

0 commit comments

Comments
 (0)
0