20 $this->__baseClassName = $config[
'baseClassName'];
21 $this->__baseClass =
new $this->__baseClassName($fred,$config);
22 $this->__log = $fred->get(
'log');
23 return parent::__construct($fred,$config);
27 $message = $this->__baseClassName .
'->' . $key;
28 if(($prio = $this->__prio[
'get:before'] ?? null) !== null) $this->__log->add($prio,$message);
29 $value = $this->__baseClass->$key;
30 if(($prio = $this->__prio[
'get:after'] ?? null) !== null) $this->__log->add($prio,$message .
' => ' . (is_scalar($value) ? $value :
'...'),is_array($value) ? $value : null);
34 public function __set($key,$value){
35 $message = $this->__baseClassName .
'->' . $key;
36 if(($prio = $this->__prio[
'set:before'] ?? null) !== null) $this->__log->add($prio,$message .
' <= ' . (is_scalar($value) ? $value :
'...'),is_array($value) ? $value : null);
37 $this->__baseClass->$key = $value;
38 if(($prio = $this->__prio[
'set:after'] ?? null) !== null) $this->__log->add($prio,$message .
' = ' . (is_scalar($value) ? $value :
'...'),is_array($value) ? $value : null);
41 public function __call($func_name,$params){
42 $message = $this->__baseClassName .
"::$func_name(";
44 foreach($params as $index => $param){
45 if(is_scalar($param)) $context[] = $param;
46 elseif(is_array($param)){
50 elseif(is_object($param)) $context[] = $param = get_class($param);
51 else $context[] = $param =
'...';
52 $message .= $param . ($index + 1 < count($params) ?
',' :
')');
54 if(($prio = $this->__prio[
'call:before'] ?? null) !== null) $this->__log->add($prio,$message,$context);
55 $result = call_user_func_array([$this->__baseClass,$func_name],$params);
56 if(($prio = $this->__prio[
'call:after'] ?? null) !== null){
57 if(is_scalar($result) || is_array($result)) $context[
'result'] = $result;
58 $this->__log->add($prio,$message .
' => ' . (is_scalar($result) ? $result :
'...'),$context);
__construct($fred, $config=null)
const DEBUG
Debug-level message.
__call($func_name, $params)