[Profiler][Logger] fixed cycle odd/even.

This commit is contained in:
Abdellatif Ait boudad 2015-04-05 23:50:35 +01:00
parent 80546293af
commit 9a9c56f4fe
1 changed files with 3 additions and 1 deletions

View File

@ -88,10 +88,12 @@
{% if collector.logs %}
<ul class="alt">
{% set log_loop_index = 0 %}
{% for log in collector.logs %}
{% set is_deprecation = log.context.level is defined and log.context.type is defined and (constant('E_DEPRECATED') == log.context.type or constant('E_USER_DEPRECATED') == log.context.type) %}
{% if priority == '-100' ? is_deprecation : log.priority >= priority %}
<li class="{{ cycle(['odd', 'even'], loop.index) }}{% if log.context.scream is defined %} scream{% elseif log.priority >= 400 %} error{% elseif log.priority >= 300 %} warning{% endif %}">
{% set log_loop_index = log_loop_index + 1 %}
<li class="{{ cycle(['odd', 'even'], log_loop_index) }}{% if log.context.scream is defined %} scream{% elseif log.priority >= 400 %} error{% elseif log.priority >= 300 %} warning{% endif %}">
{{ logger.display_message(loop.index, log, is_deprecation) }}
</li>
{% endif %}