1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
<?php
namespace oroboros\core\abstracts\libraries\logger;
class AbstractLogger extends \oroboros\core\abstracts\OroborosBaseAbstract implements \oroboros\core\interfaces\api\LoggerApi, \oroboros\core\interfaces\api\LogLevelApi {
const CLASS_SCOPE = \oroboros\core\interfaces\api\ClassScopeApi::CLASS_SCOPE_LIBRARY;
const API = '\\oroboros\\core\\interfaces\\api\\LoggerApi';
public function __construct(array $params = array(), array $flags = array()) {
parent::__construct($params, $flags);
}
public function __destruct() {
parent::__destruct();
}
public function emergency($message, array $context = array()) {
return $this->log(self::EMERGENCY, $message, $context);
}
public function alert($message, array $context = array()) {
return $this->log(self::ALERT, $message, $context);
}
public function critical($message, array $context = array()) {
return $this->log(self::CRITICAL, $message, $context);
}
public function error($message, array $context = array()) {
return $this->log(self::ERROR, $message, $context);
}
public function warning($message, array $context = array()) {
return $this->log(self::WARNING, $message, $context);
}
public function notice($message, array $context = array()) {
return $this->log(self::NOTICE, $message, $context);
}
public function info($message, array $context = array()) {
return $this->log(self::INFO, $message, $context);
}
public function debug($message, array $context = array()) {
return $this->log(self::DEBUG, $message, $context);
}
public function log($level, $message, array $context = array()) {
return TRUE;
}
function interpolate($message, array $context = array()) {
$replace = array();
foreach ($context as $key => $val) {
$replace['[]' . strtoupper($key) . '[/]'] = $val;
}
return strtr($message, $replace);
}
}