Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61d336b

Browse files
committed
feature #24151 Display the log context in the debug pages (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #24151). Discussion ---------- Display the log context in the debug pages | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23589 | License | MIT | Doc PR | - ### Before ![before](https://user-images.githubusercontent.com/73419/30269760-564ff2e8-96ea-11e7-98fa-0610d6a0322f.png) ### After ![after](https://user-images.githubusercontent.com/73419/30269764-5830482e-96ea-11e7-946a-a6805c28741a.png) I'd like to exclude the `event` channel context because it only adds noise: ![event-noise](https://user-images.githubusercontent.com/73419/30269774-67036f52-96ea-11e7-87c0-5ef8328f315a.png) ----- This change would require to add a hard dependency to the VarDumper component. Do we want to do that? Thanks! Commits ------- c59fbde Display the log context in the debug pages
2 parents 722c816 + c59fbde commit 61d336b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Symfony/Bundle/TwigBundle/Resources/views/Exception/logs.html.twig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
{{ log.channel }}
3030
</td>
3131
{% endif %}
32-
<td>{{ log.message|format_log_message(log.context) }}</td>
32+
<td>
33+
{{ log.message|format_log_message(log.context) }}
34+
{% if log.context ?? false %}
35+
<pre class="text-muted prewrap m-t-5">{{ log.context|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_UNICODE') b-or constant('JSON_UNESCAPED_SLASHES')) }}</pre>
36+
{% endif %}
37+
</td>
3338
</tr>
3439
{% endfor %}
3540
</tbody>

src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgb
1717
table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; }
1818
table th { background-color: #E0E0E0; font-weight: bold; text-align: left; }
1919

20+
.m-t-5 { margin-top: 5px; }
2021
.hidden-xs-down { display: none; }
2122
.block { display: block; }
2223
.hidden { display: none; }
24+
.prewrap { white-space: pre-wrap; }
2325
.nowrap { white-space: nowrap; }
2426
.newline { display: block; }
2527
.break-long-words { word-wrap: break-word; overflow-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; min-width: 0; }

0 commit comments

Comments
 (0)