Generate the indicators column.

@param \stdClass $log log data.
@return string HTML for the indicators column
494861
public function col_indicators($log) {
        $indicatorclasses = json_decode($log->indicators);
        $indicators = array();
        foreach ($indicatorclasses as $indicatorclass) {
            $indicator = \core_analytics\manager::get_indicator($indicatorclass);
            if ($indicator) {
                $indicators[] = $indicator->get_name();
            } else {
                debugging('Can\'t load ' . $indicatorclass . ' indicator', DEBUG_DEVELOPER);
            }
        }
        return '<ul><li>' . implode('</li><li>', $indicators) . '</li></ul>';
    }
1310432
public function getHtmlColumnHeader(): string
  {
    $attributes = [];
    $classes    = [];

    if ($this->headerText===null)
    {
      $classes[] = 'empty';
    }
    else
    {
      if ($this->sortable)
      {
        // Add class indicating this column can be used for sorting.
        $classes[] = 'sort';

        // Add attributes indicating the sort order of this column and direction.
        if ($this->sortOrder!==null)
        {
          $attributes['data-sort-order'] = $this->sortOrder;

          $classes[] = ($this->sortDirection=='desc') ? 'sorted-desc' : 'sorted-asc';
        }
      }
    }

    $attributes['class'] = implode(' ', $classes);

    return Html::generateElement('th', $attributes, $this->headerText);
  }
1143124
public function parseLog($log)
    {
        $commits = $tags = [];

        for ($i = 0, $lines = count($log); $i < $lines; $i++) {
            $tmp = explode(': ', $log[$i]);
            $tmp = array_map('trim', $tmp);

            if ($tmp[0] == 'changeset') {
                $commit = $tmp[1];
            }

            if ($tmp[0] == 'user') {
                $email  = $this->extractEmail($tmp[1]);
                $author = $this->extractAuthor($tmp[1]);
            }

            if ($tmp[0] == 'date') {
                $date = trim($tmp[1]);
            }

            if ($tmp[0] == 'tag') {
                $tags[] = trim($tmp[1]);
            }

            if ($tmp[0] == 'summary') {
                $commits[] = [
                    'commit'  => trim($commit),
                    'author'  => trim($author),
                    'email'   => trim($email),
                    'date'    => DateTime::createFromFormat('D M j H:i:s Y O', $date),
                    'summary' => trim($tmp[1]),
                    'tags'    => $tags,
                    'vcs'     => trim($this->repository_type),
                ];
                $tags = [];
            }
        }

        return $commits;
    }
499332
public function log_display($loghtml) {
        $out = html_writer::start_div('backup_log');
        $out .= $this->output->heading(get_string('backuplog', 'backup'));
        $out .= html_writer::start_div('backup_log_contents');
        $out .= $loghtml;
        $out .= html_writer::end_div();
        $out .= html_writer::end_div();
        return $out;
    }
979947
protected function processLogs($logs)
	{
		$message='';
		foreach($logs as $log)
			$message.=$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]);
		$message=wordwrap($message,70);
		$subject=$this->getSubject();
		if($subject===null)
			$subject=Yii::t('yii','Application Log');
		foreach($this->getEmails() as $email)
			$this->sendEmail($email,$subject,$message);
	}
128259
private function get_log_level( $level, $log_level ) {
		if ( ! isset( $log_level[ $level ] ) && ! isset( $log_level[''] ) ) {
			return 'info';
		}
		'' === $level || ! isset( $log_level[ $level ] ) and $level = $log_level[''];
		if ( empty( $log_level[ $level ] ) ) {
			return 'info';
		}

		return $level;
	}
273683
protected function innerWrite($log, $level = 1, $prefix = null) {
        $level = intval($level);
        if(intval($level) < $this->log_level || $this -> out === null){
            return;
        }
        
        $timestamp = time();
        
        $prefix = $prefix === null ? $this->prefix : $prefix;
        
        $tag = $this->tags[$level];
        
        $msg = "[$tag][$timestamp][$prefix] $log; \n";
        
        if (is_callable($this -> out)) {
            $out = $this -> out;
            $out($msg . '<br />');   // if out to page , add the BR, easy to watch 
            return;
        }
        
        fwrite($this -> out, $msg);
    }
293635
public StringBuilder generate(Log log) {
		StringBuilder s = new StringBuilder();
		for (int i = 0; i < parts.length; ++i)
			parts[i].append(s, log);
		if (log.trace != null)
			appendStack(s, log.trace);
		return s;
	}
838093
private function writeLog($log)
    {
        $fh = fopen($this->_filepath, 'a');

        fwrite($fh, $log);
        fclose($fh);
    }
805281
public function log(array $log)
    {
        $log['db'] = $this->database->getName();
        $log['collection'] = $this->getName();
        call_user_func($this->loggerCallable, $log);
    }
1031012
public function makeLog()
    {
        $log = new CompetencyProgressLog();
        $log->setCompetency($this->competency);
        $log->setUser($this->user);
        $log->setPercentage($this->percentage);
        $log->setDate($this->date);

        if ($this->level) {
            $log->setLevel($this->level);
        }

        return $log;
    }
620259
public static function logLevel($level)
  {
    if(is_numeric($level))
    {
      if($level == TeamSpeak3::LOGLEVEL_CRITICAL)
        return "CRITICAL";
      if($level == TeamSpeak3::LOGLEVEL_ERROR)
        return "ERROR";
      if($level == TeamSpeak3::LOGLEVEL_DEBUG)
        return "DEBUG";
      if($level == TeamSpeak3::LOGLEVEL_WARNING)
        return "WARNING";
      if($level == TeamSpeak3::LOGLEVEL_INFO)
        return "INFO";

      return "DEVELOP";
    }
    else
    {
      if(strtoupper($level) == "CRITICAL")
        return TeamSpeak3::LOGLEVEL_CRITICAL;
      if(strtoupper($level) == "ERROR")
        return TeamSpeak3::LOGLEVEL_ERROR;
      if(strtoupper($level) == "DEBUG")
        return TeamSpeak3::LOGLEVEL_DEBUG;
      if(strtoupper($level) == "WARNING")
        return TeamSpeak3::LOGLEVEL_WARNING;
      if(strtoupper($level) == "INFO")
        return TeamSpeak3::LOGLEVEL_INFO;

      return TeamSpeak3::LOGLEVEL_DEVEL;
    }
  }
563354
public static function logLevel($level)
    {
        if (is_numeric($level)) {
            if ($level == Teamspeak::LOGLEVEL_CRITICAL) {
                return "CRITICAL";
            }
            if ($level == Teamspeak::LOGLEVEL_ERROR) {
                return "ERROR";
            }
            if ($level == Teamspeak::LOGLEVEL_DEBUG) {
                return "DEBUG";
            }
            if ($level == Teamspeak::LOGLEVEL_WARNING) {
                return "WARNING";
            }
            if ($level == Teamspeak::LOGLEVEL_INFO) {
                return "INFO";
            }

            return "DEVELOP";
        } else {
            if (strtoupper($level) == "CRITICAL") {
                return Teamspeak::LOGLEVEL_CRITICAL;
            }
            if (strtoupper($level) == "ERROR") {
                return Teamspeak::LOGLEVEL_ERROR;
            }
            if (strtoupper($level) == "DEBUG") {
                return Teamspeak::LOGLEVEL_DEBUG;
            }
            if (strtoupper($level) == "WARNING") {
                return Teamspeak::LOGLEVEL_WARNING;
            }
            if (strtoupper($level) == "INFO") {
                return Teamspeak::LOGLEVEL_INFO;
            }

            return Teamspeak::LOGLEVEL_DEVEL;
        }
    }
88560
public function format_grade_for_log(stdClass $grade) {
        global $DB;

        $user = $DB->get_record('user', array('id' => $grade->userid), '*', MUST_EXIST);

        $info = get_string('gradestudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user)));
        if ($grade->grade != '') {
            $info .= get_string('grade') . ': ' . $this->display_grade($grade->grade, false) . '. ';
        } else {
            $info .= get_string('nograde', 'assign');
        }
        return $info;
    }
759557
public function formatBytes($bytes, $showUnits = false, $log = 1024): string
	{
		$units = array('B', 'KB', 'MB', 'GB', 'TB');
		$bytes = max($bytes, 0);
		$pow = floor(($bytes ? log($bytes) : 0) / log($log));
		$pow = min($pow, count($units) - 1);
		$bytes /= (1 << (10 * $pow));

		return round($bytes, 2) . ($showUnits ? ' ' . $units[$pow] : '');
	}
186297
public function save($log_dir = '')
    {
        if (empty($log_dir)) {
            $log_dir = \ROOT . '/private/logs/syslog/';
        }

        if (!is_dir($log_dir)) {
            mkdir($log_dir, 0777, true);
        }

        return file_put_contents($log_dir . date('Y_m_d') . '.log',
                $this->message . "\n", \FILE_APPEND);
    }
32297
protected function parseLog($log)
    {
        preg_match_all(LogParser::getMatchString(), $log, $matches);
        $metaData = [];
        $numEntries = count($matches[1]);
        for ($i = 0; $i < $numEntries; $i++) {
            $hash = $matches[1][$i];
            $name = $matches[2][$i];
            $eMail = $matches[3][$i];
            $timeStamp = (int)$matches[4][$i];
            $message = $matches[5][$i];
            $metaData[] = new CommitMetadata($hash, $name, $eMail, $timeStamp, $message);
        }

        return $metaData;
    }