loglevel = self::$instance->level2int($level); } private function Log ($level,&$a) { $a[0] = self::$instance->level2string($level) . ': ' . $a[0] . PHP_EOL; call_user_func_array('printf',$a); } public function Debug ($msg) { self::singleton(); if ( self::$instance->loglevel < 5 ) return 0; self::$instance->Log(5,func_get_args()); } public function Verbose ($msg) { self::singleton(); if ( self::$instance->loglevel < 4 ) return 0; self::$instance->Log(4,func_get_args()); } public function Info ($msg) { self::singleton(); if ( self::$instance->loglevel < 3 ) return 0; self::$instance->Log(3,func_get_args()); } public function Warning ($msg) { self::singleton(); if ( self::$instance->loglevel < 2 ) return 0; self::$instance->Log(2,func_get_args()); } public function Error ($msg) { self::singleton(); if ( self::$instance->loglevel < 1 ) return 0; self::$instance->Log(1,func_get_args()); } public function Fatal ($msg) { self::singleton(); self::$instance->Log(0,func_get_args()); exit(1); } } ?>