OSDN Git Service

modified: epgwakealarm.php 省電力少し修正
[epgrec/epgrec.git] / recLog.inc.php
1 <?php
2
3 define( "EPGREC_INFO" , 0 );
4 define( "EPGREC_WARN" , 1 );
5 define( "EPGREC_ERROR", 2 );
6
7 class RecException extends Exception {
8         
9         private $level = EPGREC_INFO;
10         
11         public function __construct( $mesg, $l = EPGREC_INFO ) {
12                 parent::__construct( $mesg );
13                 $this->level = $l;
14         }
15         
16         public function getLevel() {
17                 return $this->level;
18         }
19 }
20
21
22 function reclog( $message , $level = EPGREC_INFO ) {
23         
24         try {
25                 $log = new DBRecord( LOG_TBL );
26                 
27                 $log->logtime = date("Y-m-d H:i:s");
28                 $log->level = $level;
29                 $log->message = $message;
30         }
31         catch( Exception $e ) {
32                 // 
33         }
34 }
35
36 ?>