added general logger
This commit is contained in:
parent
e191145979
commit
7e790a5470
19
include/library/Crunchbutton/Log.php
Normal file
19
include/library/Crunchbutton/Log.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Crunchbutton_Log extends Cana_Table {
|
||||||
|
public static function __callStatic($func, $args) {
|
||||||
|
$log = new Log;
|
||||||
|
$log->level = $func;
|
||||||
|
$log->data = json_encode($args);
|
||||||
|
$log->date = date('Y-m-d H:i:s');
|
||||||
|
$log->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct($id = null) {
|
||||||
|
parent::__construct();
|
||||||
|
$this
|
||||||
|
->table('log')
|
||||||
|
->idVar('id_log')
|
||||||
|
->load($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user