protected function add_log($message, $level, $a = null, $depth = null, $display = false) {
        // Adding the result to the oldest parent.
        if ($this->get_parent()) {
            $parent = $this->get_grandparent();
            $parent->add_log($message, $level, $a, $depth, $display);
        } else {
            $log = new stdClass();
            $log->message = $message;
            $log->level = $level;
            $log->a = $a;
            $log->depth = $depth;
            $log->display = $display;
            $this->logs[] = $log;
        }
    }
protected function add_log($message, $level, $a = null, $depth = null, $display = false) {
        // Adding the result to the oldest parent.
        if ($this->get_parent()) {
            $parent = $this->get_grandparent();
            $parent->add_log($message, $level, $a, $depth, $display);
        } else {
            $log = new stdClass();
            $log->message = $message;
            $log->level = $level;
            $log->a = $a;
            $log->depth = $depth;
            $log->display = $display;
            $this->logs[] = $log;
        }
    }
protected function add_log ( $ message , $ level , $ a = null , $ depth = null , $ display = false ) { // Adding the result to the oldest parent. if ( $ this -> get_parent ( ) ) { $ parent = $ this -> get_grandparent ( ) ; $ parent -> add_log ( $ message , $ level , $ a , $ depth , $ display ) ; } else { $ log = new stdClass ( ) ; $ log -> message = $ message ; $ log -> level = $ level ; $ log -> a = $ a ; $ log -> depth = $ depth ; $ log -> display = $ display ; $ this -> logs [ ] = $ log ; } }
Saves a log message to an array

@see backup_helper::log()
@param string $message to add to the logs
@param int $level level of importance {@link backup::LOG_DEBUG} and other constants
@param mixed $a to be included in $message
@param int $depth of the message
@param display $bool supporting translation via get_string() if true
@return void
Saves a log message to an array