stream = $stream; } else { throw new \RuntimeException(sprintf('Unable to open %s for writing', $destination)); } } public function write($level, string $message, array $context): void { fwrite($this->stream, Formatter::format($level, $message, $context)); } }