added general logger

This commit is contained in:
arzynik 2012-11-26 12:42:19 -05:00
parent e191145979
commit 7e790a5470

View 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);
}
}