public function setLogger(\BearFramework\App\ILogger $logger): self
    {
        if ($this->logger !== null) {
            throw new \Exception('A logger is already set!');
        }
        $this->logger = $logger;
        return $this;
    }
public function setLogger(\BearFramework\App\ILogger $logger): self
    {
        if ($this->logger !== null) {
            throw new \Exception('A logger is already set!');
        }
        $this->logger = $logger;
        return $this;
    }
public function setLogger ( \ BearFramework \ App \ ILogger $ logger ) : self { if ( $ this -> logger !== null ) { throw new \ Exception ( 'A logger is already set!' ) ; } $ this -> logger = $ logger ; return $ this ; }
Sets a new logger.

@param \BearFramework\App\ILogger $logger The logger to use.
@return self Returns a reference to itself.
@throws \Exception
Sets a new logger .