<?php

namespace Velis\Log\Processor;

use Velis\App;

/**
 * @author Szymon Janaczek <szymon.janaczek@singu.com>
 */
final class CorrelationIdProcessor
{
    /**
     * @param array<string, string|array<string, mixed> $record
     * @return array<string, string|array<string, mixed>
     */
    public function __invoke(array $record): array
    {
        $record['extra']['correlationId'] = App::getInstance()->getCorrelationId();

        return $record;
    }
}
