@param array $record

@return array
172280
public function formatV1(array $record)
    {
        if (empty($record['datetime'])) {
            $record['datetime'] = gmdate('c');
        }
        $message = array(
            '@timestamp' => $record['datetime'],
            '@version' => version(),
            'host' => $this->systemName,
        );
        if (isset($record['message'])) {
            $message['message'] = $record['message'];
        }
        if (isset($record['channel'])) {
            $message['channel'] = $record['channel'];
        }
        if (isset($record['level_name'])) {
            $message['level'] = $record['level_name'];
        }
        if (!empty($record['extra'])) {
            foreach ($record['extra'] as $key => $val) {
                $message[$this->extraPrefix.$key] = $val;
            }
        }
        if (!empty($record['context'])) {
            foreach ($record['context'] as $key => $val) {
                $message[$this->contextPrefix.$key] = $val;
            }
        }

        if (isset($message['trace']) && is_array($message['trace'])) {
            $message['trace'] = implode(PHP_EOL, $message['trace']);
        }

        return $message;
    }
267460
private function translateRecordIntoEventMessage(array $record)
    {
        $identifier = new MessageIdentifier($record['event_id']);

        $payload = $this->eventSerializer->deserializePayload(
            $record['event_payload'],
            Contract::createFromClassName($record['event_payload_type'])
        );

        $metadata = $this->eventSerializer->deserializeMetadata(
            $record['event_metadata'],
            Contract::createFromClassName($record['event_metadata_type'])
        );

        $sequenceNumber = (int) $record['aggregate_version'];

        $eventMessage = new GenericEvent($this->aggregateRootIdentifier, $sequenceNumber, $identifier, $payload, $metadata);

        return $eventMessage;
    }
151934
public function format(array $record)
    {
        if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) {
            $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
            // TODO 2.0 unset the 'datetime' parameter, retained for BC
        }

        return parent::format($record);
    }
113388
public function handle(array $record)
    {
        if (!$this->isHandling($record)) {
            return false;
        }

        if (class_exists('Drips\Debugbar\Debugbar')) {
            $debugbar = Debugbar::getInstance();
            if (!$debugbar->hasTab('logger')) {
                $debugbar->registerTab('logger', 'Logs', '<style>' . file_get_contents(__DIR__ . '/style.css') . '</style>');
            }
            $color = $this->logLevels[$record['level']];
            $channel = $record['channel'];
            $level = $record['level_name'];
            $message = $record['message'];
            $log_message = "
            <code class='drips-logger-record' style='color: $color'>
                <table>
                    <tr>
                        <td valign='top'><span class='debug-badge debug-channel'>$channel</span></td>
                        <td valign='top'><strong class='debug-badge' style='background-color: $color'>$level</strong></td>
                        <td valign='top' style='color: $color'>$message</td>
                    </tr>
                </table>
            </code>
           ";
            $debugbar->appendTab('logger', $log_message);
        }

        return false === $this->bubble;
    }
1048116
protected function formatRecordsList(array $records)
    {
        return collect($records)->mapWithKeys(function ($attributes, $id) {
            if (!is_array($attributes)) {
                list($id, $attributes) = [$attributes, []];
            }

            return [$id => $attributes];
        })->all();
    }
473941
public function format(array $record)
    {
        $emoji = $this->getEmojiForLevel($record['level']);
        $output = parent::format($record);

        return $emoji . $output;
    }
878340
public static function getValues(GedcomRecord $record = null): array
    {
        $values = [];
        foreach (self::TYPES as $type) {
            $values[$type] = self::getValue($type, $record);
        }
        uasort($values, '\Fisharebest\Webtrees\I18N::strcasecmp');

        return $values;
    }
532479
protected function getReplacements(Record $record)
    {
        $replacements = [];

        foreach ($record->getContext() as $key => $val) {
            if (null === $val || is_scalar($val) || method_exists($val, '__toString')) {
                $replacements['{'.$key.'}'] = $val;
            } elseif (is_object($val)) {
                $replacements['{'.$key.'}'] = '[object '.get_class($val).']';
            } else {
                $replacements['{'.$key.'}'] = '['.gettype($val).']';
            }
        }

        return $replacements;
    }
572455
protected function prepare( Record_Interface $record ): array {

		$data = [
			'description' => $record->get_description(),
			'category'    => $record->get_category(),
			'offset'      => round( ( $record->get_origin() - $this->origin ) / $this->total * 100, 2 ),
			'width'       => round( $record->get_duration() / $this->total * 100, 2 ),
		];

		return $data;
	}
845433
public function new(array $record = [])
    {
        $record = $this->prepareBaseRecord($record);

        return $this->cleanClone()->addPristineRecord($record, ['isCasted' => true])->markAsNew();
    }
1112894
public function getSpecificIds(array $record)
    {
        $specificIds = [];
        $specificIds['uid'] = (int)$record['uid'];
        $specificIds['pid'] = (int)$record['pid'];

        if (self::getBackendUser()->workspace > 0 && !empty($record['t3ver_oid'])) {
            $specificIds['uid'] = (int)$record['t3ver_oid'];
            $specificIds['pid'] = -1;
        }

        return $specificIds;
    }
80190
protected function mapMapping(array $record, Mapping $mapping, $context = null, $key = null)
    {
        $mapped = $this->mapFragment($record, $mapping->toArray(), $context, $key);

        if ($mapping->isWrapped()) {
            // Unwrap.
            return $mapped[0];
        }

        return $mapped;
    }
1112274
public function format(array $record)
    {
        $this->addRow($record['level_name'], $record['level']);
        $this->addRow('Message', (string) $record['message']);
        $this->addRow('Time', $record['datetime']->format($this->dateFormat));
        $this->addRow('Channel', $record['channel']);

        if (isset($record['context']['file'])) {
            $this->addRow('File', $record['context']['file']);
            $this->addRow('Line', $record['context']['line']);
        }

        if (isset($record['context']['exception'])) {
            $trace = explode(PHP_EOL, $record['context']['exception']->getTraceAsString());
            $this->addRow('Trace', array_shift($trace));
            foreach ($trace as $row) {
                $this->addRow('', $row);
            }
        }

        return $this->render($this->getColoursByLogLevel($record['level']));
    }
219534
public function getHeaderRowFromRecords(Collection $records): array
    {
        $titles = collect(Arr::dot($records->first()->toArray()))->keys()->map(
            function ($key) {
                $key = str_replace('.', ' ', $key);

                return Str::ucfirst($key);
            }
        );

        return $titles->toArray();
    }
1334317
protected static function _getRecordClass($record)
    {
        $static = get_called_class();

        if (!static::fieldExists('Class')) {
            return $static;
        }

        $columnName = static::_cn('Class');

        if (!empty($record[$columnName]) && is_subclass_of($record[$columnName], $static)) {
            return $record[$columnName];
        } else {
            return $static;
        }
    }
1073270
protected function prepareRecord($record)
    {
        if ($record[static::REMOVE_FLAG_NAME] == 1) {
            return $record;
        }

        $prepared = [];

        /* @var Field $field */
        foreach ($this->fields as $field) {
            $columns = $field->column();

            $value = $this->fetchColumnValue($record, $columns);

            if (is_null($value)) {
                continue;
            }

            if (method_exists($field, 'prepare')) {
                $value = $field->prepare($value);
            }

            if (($field instanceof \Encore\Admin\Form\Field\Hidden) || $value != $field->original()) {
                if (is_array($columns)) {
                    foreach ($columns as $name => $column) {
                        Arr::set($prepared, $column, $value[$name]);
                    }
                } elseif (is_string($columns)) {
                    Arr::set($prepared, $columns, $value);
                }
            }
        }

        $prepared[static::REMOVE_FLAG_NAME] = $record[static::REMOVE_FLAG_NAME];

        return $prepared;
    }
1141423
private function formatRecords(array $entry)
    {
        $entries = str_split($entry['formatted'], self::EVENT_SIZE_LIMIT);
        $timestamp = $entry['datetime']->format('U.u') * 1000;
        $records = [];

        foreach ($entries as $entry) {
            $records[] = [
                'message' => $entry,
                'timestamp' => $timestamp
            ];
        }

        return $records;
    }