public function addLog($key, $message)
    {
        if (!is_string($message)) {
            throw new \InvalidArgumentException(sprintf(
                '[%s]: "message" must be type of string, %s given.',
                __METHOD__,
                gettype($message)
            ));
        }

        if (!isset($this->logs[$key])) {
            $this->logs[$key] = [];
        }

        $this->logs[$key][] = $message;

        return $this;
    }
public function addLog($key, $message)
    {
        if (!is_string($message)) {
            throw new \InvalidArgumentException(sprintf(
                '[%s]: "message" must be type of string, %s given.',
                __METHOD__,
                gettype($message)
            ));
        }

        if (!isset($this->logs[$key])) {
            $this->logs[$key] = [];
        }

        $this->logs[$key][] = $message;

        return $this;
    }
public function addLog ( $ key , $ message ) { if ( ! is_string ( $ message ) ) { throw new \ InvalidArgumentException ( sprintf ( '[%s]: "message" must be type of string, %s given.' , __METHOD__ , gettype ( $ message ) ) ) ; } if ( ! isset ( $ this -> logs [ $ key ] ) ) { $ this -> logs [ $ key ] = [ ] ; } $ this -> logs [ $ key ] [ ] = $ message ; return $ this ; }
Adds new message to logs.

@param string $key
@param string $message
@return self
@throws \InvalidArgumentException if message argument is not type of string
Adds new message to logs .