]>
git.wh0rd.org - tt-rss.git/blob - classes/logger.php
3 private static $instance;
6 public static $errornames = array(
12 32 => 'E_CORE_WARNING',
13 64 => 'E_COMPILE_ERROR',
14 128 => 'E_COMPILE_WARNING',
15 256 => 'E_USER_ERROR',
16 512 => 'E_USER_WARNING',
17 1024 => 'E_USER_NOTICE',
19 4096 => 'E_RECOVERABLE_ERROR',
20 8192 => 'E_DEPRECATED',
21 16384 => 'E_USER_DEPRECATED',
24 function log_error($errno, $errstr, $file, $line, $context) {
25 if ($errno == E_NOTICE
) return false;
28 return $this->adapter
->log_error($errno, $errstr, $file, $line, $context);
33 function log($string) {
35 return $this->adapter
->log($string);
40 private function __clone() {
44 function __construct() {
45 switch (LOG_DESTINATION
) {
47 $this->adapter
= new Logger_SQL();
50 $this->adapter
= new Logger_Syslog();
53 $this->adapter
= false;
57 public static function get() {
58 if (self
::$instance == null)
59 self
::$instance = new self();
61 return self
::$instance;