public function create() : LoggerInterface
    {
        $loggerType = $this->config['type'] ?? 'null';
        switch ($loggerType) {
            case 'file':
                return new Logger($this->config['path'], $this->config['level']);
            case 'null':
                return new NullLogger;
            default:
                throw new \RuntimeException('Invalid logger type');
        }
    }
public function create() : LoggerInterface
    {
        $loggerType = $this->config['type'] ?? 'null';
        switch ($loggerType) {
            case 'file':
                return new Logger($this->config['path'], $this->config['level']);
            case 'null':
                return new NullLogger;
            default:
                throw new \RuntimeException('Invalid logger type');
        }
    }
public function create ( ) : LoggerInterface { $ loggerType = $ this -> config [ 'type' ] ?? 'null' ; switch ( $ loggerType ) { case 'file' : return new Logger ( $ this -> config [ 'path' ] , $ this -> config [ 'level' ] ) ; case 'null' : return new NullLogger ; default : throw new \ RuntimeException ( 'Invalid logger type' ) ; } }
Creates logger depending on configuration.

@return LoggerInterface
Creates logger depending on configuration .