Skip to content

Commit 1abfecf

Browse files
committed
minor #16658 Fixes the stack traces of the deprecation logs (javiereguiluz)
This PR was merged into the 2.8 branch. Discussion ---------- Fixes the stack traces of the deprecation logs | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16640 | License | MIT | Doc PR | The stack trace information was displayed in a very confusing way. Now it's easier to understand what is called from which file and line. ### Before ![stack_trace_before](https://cloud.githubusercontent.com/assets/73419/11392640/5c02607a-935b-11e5-8f99-812fbd97aad3.png) ### After ![stack_trace_after](https://cloud.githubusercontent.com/assets/73419/11392650/5f0b821a-935b-11e5-8472-7fae9bd21149.png) Commits ------- 09f4895 Fixes the stack traces of the deprecation logs
2 parents 074a4bf + 09f4895 commit 1abfecf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
{% if index == 2 %}
170170
<ul class="sf-call-stack" id="{{ id }}" class="hidden">
171171
{% endif %}
172+
172173
{% if call.class is defined %}
173174
{% set from = call.class|abbr_class ~ '::' ~ call.function|abbr_method() %}
174175
{% elseif call.function is defined %}
@@ -179,7 +180,14 @@
179180
{% set from = '-' %}
180181
{% endif %}
181182

182-
<li><span class="text-small">Called from</span> {{ call.file is defined and call.line is defined ? call.file|format_file(call.line, from) : from|raw }}</li>
183+
{% set file_name = (call.file is defined and call.line is defined) ? call.file|replace({'\\': '/'})|split('/')|last %}
184+
185+
<li>
186+
{{ from|raw }}
187+
{% if file_name %}
188+
<span class="text-small">(called from {{ call.file|format_file(call.line, file_name)|raw }})</span>
189+
{% endif %}
190+
</li>
183191

184192
{% if index == stack|length - 1 %}
185193
</ul>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy