From ef1e50802ed4af6e4d59688d4facd84925327ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 19 Jul 2017 13:44:58 +0200 Subject: [PATCH] [WebProfilerBundle] Display trace and context in the logger profiler --- .../views/Collector/logger.html.twig | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index 373233afa8..6e92022a44 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -224,31 +224,33 @@ {% endmacro %} {% macro render_log_message(category, log_index, log) %} - {% if log.context.exception.trace is defined %} + {% set has_context = log.context is defined and log.context is not empty %} + {% set has_trace = log.context.exception.trace is defined %} + + {% if not has_context %} + {{ profiler_dump_log(log.message) }} + {% else %} {{ profiler_dump_log(log.message, log.context) }} - {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} +
+ {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} + Show context -
-
+
+ {{ profiler_dump(log.context, maxDepth=1) }} +
+ + {% if has_trace %} +
{{ profiler_dump(log.context.exception.trace, maxDepth=1) }}
- - {% elseif log.context is defined and log.context is not empty %} - {{ profiler_dump_log(log.message, log.context) }} - - {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} - - - {% else %} - {{ profiler_dump_log(log.message) }} + {% endif %} {% endif %} {% endmacro %}