HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
log.php
Go to the documentation of this file.
1 <?php
2 /* @var Yii2LogPanel $this */
3 /* @var array $data */
4 ?>
5 <table class="table table-condensed table-bordered table-striped table-hover table-filtered" style="table-layout: fixed;">
6  <thead>
7  <tr>
8  <th style="width: 100px;">Time</th>
9  <th style="width: 65px;">Level</th>
10  <th style="width: 250px;">Category</th>
11  <th>Message</th>
12  </tr>
13  </thead>
14  <tbody>
15  <?php foreach ($data['messages'] as $log): ?>
16  <?php
17  list ($message, $level, $category, $time, $traces) = $log;
18  $rowOpt = '';
19  switch ($level) {
20  case CLogger::LEVEL_ERROR:
21  $firstError = !isset($firstError);
22  if ($firstError) $rowOpt = 'id="first-error"';
23  break;
24  case CLogger::LEVEL_WARNING:
25  $firstWarning = !isset($firstWarning);
26  if ($firstWarning) $rowOpt = 'id="first-warning"';
27  break;
28  case CLogger::LEVEL_INFO:
29  $firstInfo = !isset($firstInfo);
30  if ($firstInfo) $rowOpt = 'id="first-info"';
31  break;
32  }
33  switch ($level) {
34  case CLogger::LEVEL_ERROR: $class = 'error'; break;
35  case CLogger::LEVEL_WARNING: $class = 'warning'; break;
36  case CLogger::LEVEL_INFO: $class = 'info'; break;
37  default: $class = ''; break;
38  }
39  ?>
40  <tr <?php echo $rowOpt; ?> class="<?php echo $class; ?>">
41  <td style="width:100px"><?php echo $time; ?></td>
42  <td style="width:100px"><?php echo $level; ?></td>
43  <td style="width:250px"><?php echo $category; ?></td>
44  <td>
45  <div style="overflow:auto">
46  <?php if ($category != Yii2LogPanel::CATEGORY_DUMP): ?>
47  <?php echo nl2br(CHtml::encode($message)); ?>
48  <?php else: ?>
49  <div class="src <?php echo $this->highlightCode ? 'hl' : 'no-hl'; ?>"><?php
50  CVarDumper::dump(@unserialize($message), 10, $this->highlightCode);
51  ?></div>
52  <?php endif; ?>
53  <?php if (!empty($traces)): ?>
54  <ul class="trace">
55  <?php foreach ($traces as $trace): ?>
56  <li>
57  <?php echo CHtml::encode($trace); ?>
58  </li>
59  <?php endforeach; ?>
60  </ul>
61  <?php endif; ?>
62  </div>
63  </td>
64  </tr>
65  <?php endforeach; ?>
66  </tbody>
67 </table>