public function setOutputStream($level, $stream)
    {
        if (static::$streamsMap === null) {
            $this->resetOutputStreams();
        }
        $this->checkLevel($level);
        if (!is_resource($stream)) {
            throw new \UnexpectedValueException("Argument '\$stream' must be a writable stream resource");
        }
        static::$streamsMap[$level] = $stream;
        return $this;
    }