src/Viserio/Component/Log/Logger.php
public function log($level, $message, array $context = []): void
    {
        $message = $this->formatMessage($message);

        if ($this->eventManager !== null) {
            // If the event dispatcher is set, we will pass along the parameters to the
            // log listeners. These are useful for building profilers or other tools
            // that aggregate all of the log messages for a given "request" cycle.
            $this->eventManager->trigger(
                new MessageLoggedEvent($this, $level, $message, $context)
            );
        }

        if (! \method_exists($this->logger, $level)) {
            throw new InvalidArgumentException(\sprintf(
                'Call to undefined method \Monolog\Logger::%s',
                $level
            ));
        }

        $this->logger->{$level}($message, $context);
    }
public function log($level, $message, array $context = []): void
    {
        $message = $this->formatMessage($message);

        if ($this->eventManager !== null) {
            // If the event dispatcher is set, we will pass along the parameters to the
            // log listeners. These are useful for building profilers or other tools
            // that aggregate all of the log messages for a given "request" cycle.
            $this->eventManager->trigger(
                new MessageLoggedEvent($this, $level, $message, $context)
            );
        }

        if (! \method_exists($this->logger, $level)) {
            throw new InvalidArgumentException(\sprintf(
                'Call to undefined method \Monolog\Logger::%s',
                $level
            ));
        }

        $this->logger->{$level}($message, $context);
    }
Logs with an arbitrary level.

@param mixed $level
@param mixed $message
@param array $context

@throws \Psr\Log\InvalidArgumentException

@return void