Generate the context column.

@param \stdClass $log log data.
@return string HTML for the context column
503287
public function col_timesplitting($log) {
        $timesplitting = \core_analytics\manager::get_time_splitting($log->timesplitting);
        return $timesplitting->get_name();
    }
671530
public function parse()
	{
		if (is_array($this->record->context))
			$this->record->formatted = str_replace("{log-context}", print_r($this->record->context, 1), $this->record->formatted);

		return $this->record;
	}
547224
public function log($level, $message, array $context = array()) {
		$ctx = $context;
		if(!count($ctx)) {
			$ctx = new \stdClass();
		}
		$message = sprintf($this->format, $message, json_encode($ctx, $this->jsonOptions));
		$this->logger()->log($level, $message, $context);
	}
1334827
protected function getLogPath($log)
    {

        $dir = $this->log_root.'/'.$log.'/';

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

        return $dir;
    }
327235
public function append($log)
    {
        if ($this->_lazy) {
            $context = $this->_context;

            $context->logs[] = $this->_format($log);
        } else {
            $this->_write($this->_format($log));
        }
    }
808563
def format_log_context(msg, connection=None, keyspace=None):
    """"""
    connection_info = connection or 'DEFAULT_CONNECTION'

    if keyspace:
        msg = '[Connection: {0}, Keyspace: {1}] {2}'.format(connection_info, keyspace, msg)
    else:
        msg = '[Connection: {0}] {1}'.format(connection_info, msg)
    return msg
579593
public function generateClass(Suite $suite, $context_class)
    {
        $fqn       = $context_class;
        $namespace = '';
        $pos       = strrpos($fqn, '\\');

        if ($pos) {
            $context_class = substr($fqn, $pos + 1);
            $namespace     = sprintf('namespace %s;%s', substr($fqn, 0, $pos), PHP_EOL . PHP_EOL);
        }

        return strtr(
            static::$template,
            array(
                '{namespace}'  => $namespace,
                '{class_name}' => $context_class,
            )
        );
    }
1351650
public function details($log, array $levels, $entries, $level = null)
    {
        $this->breadcrumb->onSystem();
        $dataTable = $this->errorLogDetailsTable->html();
        return $this->view('details', compact('dataTable', 'log', 'levels', 'entries', 'level'));
    }
594369
protected function getContextMessage()
    {
        $context = [];
        foreach ($this->logVars as $name) {
            if (!empty($GLOBALS[$name])) {
                $context[] = "\${$name} = " . VarDumper::dumpAsString($GLOBALS[$name]);
            }
        }

        return implode("\n\n", $context);
    }
486134
public function getColumnContent($record, $column)
    {
        if (!$this->columnDispatch) {
            $this->buildColumnDispatch();
        }

        if (!empty($this->columnDispatch[$column])) {
            $content = '';

            foreach ($this->columnDispatch[$column] as $handler) {
                /**
                 * @var GridField_ColumnProvider $handler
                 */
                $content .= $handler->getColumnContent($this, $record, $column);
            }

            return $content;
        } else {
            throw new InvalidArgumentException(sprintf(
                'Bad column "%s"',
                $column
            ));
        }
    }
1296892
protected function _report($log)
    {
        $type = $log->type();
        $this->_reportSuiteMessages($log);
        $this->_reportSpecMessage($log);
        $this->_reportFailure($log);
        $this->_indent = 0;
    }
1181530
public function render($context)
    {
        $cell = $this->getCell();
        $cell->addClass('editable');
        $cell->addAttr('data-column', $cell->getHeader()->getName());
        return $context;
    }
1310963
protected function ansi2Html($log)
    {
        $string = html_entity_decode(
            $this->ansiConverter->convert($log)
        );

        $string = str_replace("\r\n", '<br>', $string);

        $string = str_replace("\n", '<br>', $string);

        return $string;
    }
758719
public function specEnd($log = null)
    {
        switch ($log->type()) {
            case 'passed':
                $this->_write($this->_symbols['dot']);
                break;
            case 'skipped':
                $this->_write('S', 'light-grey');
                break;
            case 'pending':
                $this->_write('P', 'cyan');
                break;
            case 'excluded':
                $this->_write('X', 'yellow');
                break;
            case 'failed':
                $this->_write('F', 'red');
                break;
            case 'errored':
                $this->_write('E', 'magenta');
                break;
        }
    }
373919
public static function print_cleaned_export($log, $instance=null) {
        global $CFG, $OUTPUT, $PAGE;
        if (empty($instance) || !$instance instanceof portfolio_plugin_base) {
            $instance = portfolio_instance($log->portfolio);
        }
        $title = get_string('exportalreadyfinished', 'portfolio');
        $PAGE->navbar->add($title);
        $PAGE->set_title($title);
        $PAGE->set_heading($title);
        echo $OUTPUT->header();
        echo $OUTPUT->notification(get_string('exportalreadyfinished', 'portfolio'));
        self::print_finish_info($log->returnurl, $instance->resolve_static_continue_url($log->continueurl));
        echo $OUTPUT->continue_button($CFG->wwwroot);
        echo $OUTPUT->footer();
        exit;
    }
748481
protected function _log($contents, $log) {
		$config = [
			'level' => LOG_DEBUG,
			'scope' => 'email',
		];
		if ($log !== true) {
			if (!is_array($log)) {
				$log = ['level' => $log];
			}
			$config = array_merge($config, $log);
		}

		Log::write(
			$config['level'],
			PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message'],
			$config['scope']
		);
	}
310495
public function log($message, $context = null, $logType = null)
    {
        if (is_int($context) and is_null($logType)) {
            $logType = $context;
            $context = array();
        }

        if (!is_array($context)) {
            $context = is_null($context) ? array() : array($context);
        }

        if (!is_int($logType)) {
            $logType = self::INFO;
        }

        return call_user_func(array($this->instance, $this->logTypes[$logType]), $message, $context);
    }