<?php

namespace Kylin\Activity;

use Illuminate\Support\Traits\ForwardsCalls;

/**
 * @mixin \Kylin\Activity\ActivityLogger
 */
class PendingActivityLog
{
    use ForwardsCalls;

    protected ActivityLogger $logger;

    public function __construct(ActivityLogger $logger, ActivityLogStatus $status)
    {
        $this->logger = $logger
            ->setLogStatus($status)
            ->useLog(config('kylin-activity.default_log_name'));
    }

    public function logger(): ActivityLogger
    {
        return $this->logger;
    }

    public function __call(string $method, array $parameters): mixed
    {
        return $this->forwardCallTo($this->logger, $method, $parameters);
    }
}
