浏览代码

Merge remote branch 'vicb/profiler_log'

* vicb/profiler_log:
  [WebProfilerBundle] Always use the default background color for counters
  [WebProfilerBundle] The total number of log entries is not relevant, display only the number of errors when required
  [WebProfilerBundle] Display the number of log entries together with the number of errors
Fabien Potencier 14 年之前
父节点
当前提交
c41e16293b
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

+ 7 - 5
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

@@ -11,9 +11,11 @@
 <span class="label">
     <span class="icon"><img src="{{ asset('bundles/webprofiler/images/profiler/logger.png') }}" alt="" /></span>
     <strong>Logs</strong>
-    <span class="count">
-        <span>{{ collector.counterrors }}</span>
-    </span>
+    {% if collector.counterrors %}
+        <span class="count">
+            <span>{{ collector.counterrors }}</span>
+        </span>
+    {% endif %}
 </span>
 {% endblock %}
 
@@ -22,8 +24,8 @@
 
     {% if collector.logs %}
         <ul class="alt">
-            {% for i, log in collector.logs %}
-                <li class="{{ i is odd ? 'odd' : 'even' }}{% if 'ERR' == log.priorityName %} error{% endif %}">
+            {% for log in collector.logs %}
+                <li class="{{ cycle(['odd', 'even'], loop.index) }}{% if 'ERR' == log.priorityName %} error{% endif %}">
                     {{ log.priorityName }}
                     {{ log.message }}
                 </li>