log.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!-- start log messages -->
  2. <table class="yiiLog" width="100%" cellpadding="2" style="border-spacing:1px;font:11px Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;color:#666666;">
  3. <tr>
  4. <th style="background:black;color:white;" colspan="5">
  5. Log aplikacji
  6. </th>
  7. </tr>
  8. <tr style="background-color: #ccc;">
  9. <th style="width:120px">Znacznik czasu</th>
  10. <th>Poziom</th>
  11. <th>Kategoria</th>
  12. <th>Wiadomość</th>
  13. </tr>
  14. <?php
  15. $colors=array(
  16. CLogger::LEVEL_PROFILE=>'#DFFFE0',
  17. CLogger::LEVEL_INFO=>'#FFFFDF',
  18. CLogger::LEVEL_WARNING=>'#FFDFE5',
  19. CLogger::LEVEL_ERROR=>'#FFC0CB',
  20. );
  21. foreach($data as $index=>$log)
  22. {
  23. $color=($index%2)?'#F5F5F5':'#FFFFFF';
  24. $color=($index%2)?'#F5F5F5':'#FFFFFF';
  25. if(isset($colors[$log[1]]))
  26. $color=$colors[$log[1]];
  27. $message='<pre>'.CHtml::encode(wordwrap($log[0])).'</pre>';
  28. $time=date('H:i:s.',$log[3]).(int)(($log[3]-(int)$log[3])*1000000);
  29. echo <<<EOD
  30. <tr style="background:{$color}">
  31. <td align="center">{$time}</td>
  32. <td>{$log[1]}</td>
  33. <td>{$log[2]}</td>
  34. <td>{$message}</td>
  35. </tr>
  36. EOD;
  37. }
  38. ?>
  39. </table>
  40. <!-- end of log messages -->