~horux-dev/horux-webcli/thfo

« back to all changes in this revision

Viewing changes to yii/framework/views/lv/log.php

  • Committer: Thierry Forchelet
  • Date: 2011-02-25 13:30:15 UTC
  • Revision ID: thierry.forchelet@letux.ch-20110225133015-zxyj9w7sqv8ly971
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
                        Lietojumprogrammas žurnāls
 
6
                </th>
 
7
        </tr>
 
8
        <tr style="background-color: #ccc;">
 
9
            <th style="width:120px">Laiks</th>
 
10
                <th>Līmenis</th>
 
11
                <th>Kategorija</th>
 
12
                <th>Ziņojums</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
        if(isset($colors[$log[1]]))
 
25
                $color=$colors[$log[1]];
 
26
        $message='<pre>'.CHtml::encode(wordwrap($log[0])).'</pre>';
 
27
        $time=date('H:i:s.',$log[3]).sprintf('%06d',(int)(($log[3]-(int)$log[3])*1000000));
 
28
 
 
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 -->
 
 
b'\\ No newline at end of file'