protected function loadLogger()
    {
        $logger = null;
        if ($this->hasOption(self::LOGGER_OPTION)) {
            $loggerOptions = $this->getOption(self::LOGGER_OPTION);
            if (is_object($loggerOptions)) {
                if (is_a($loggerOptions, LoggerInterface::class)) {
                    $logger = $loggerOptions;
                }
            } elseif (is_array($loggerOptions) && isset($loggerOptions['class'])) {
                $classname = $loggerOptions['class'];
                if (is_a($classname, LoggerInterface::class, true)) {
                    if (isset($loggerOptions['options'])) {
                        $logger = new $classname($loggerOptions['options']);
                    } else {
                        $logger = new $classname();
                    }
                }
            }
        }

        if (!is_null($logger)) {
            $this->logger = $logger;
        } else {
            $this->logger = new NullLogger();
        }

        return $this->logger;
    }
protected function loadLogger()
    {
        $logger = null;
        if ($this->hasOption(self::LOGGER_OPTION)) {
            $loggerOptions = $this->getOption(self::LOGGER_OPTION);
            if (is_object($loggerOptions)) {
                if (is_a($loggerOptions, LoggerInterface::class)) {
                    $logger = $loggerOptions;
                }
            } elseif (is_array($loggerOptions) && isset($loggerOptions['class'])) {
                $classname = $loggerOptions['class'];
                if (is_a($classname, LoggerInterface::class, true)) {
                    if (isset($loggerOptions['options'])) {
                        $logger = new $classname($loggerOptions['options']);
                    } else {
                        $logger = new $classname();
                    }
                }
            }
        }

        if (!is_null($logger)) {
            $this->logger = $logger;
        } else {
            $this->logger = new NullLogger();
        }

        return $this->logger;
    }
protected function loadLogger ( ) { $ logger = null ; if ( $ this -> hasOption ( self :: LOGGER_OPTION ) ) { $ loggerOptions = $ this -> getOption ( self :: LOGGER_OPTION ) ; if ( is_object ( $ loggerOptions ) ) { if ( is_a ( $ loggerOptions , LoggerInterface :: class ) ) { $ logger = $ loggerOptions ; } } elseif ( is_array ( $ loggerOptions ) && isset ( $ loggerOptions [ 'class' ] ) ) { $ classname = $ loggerOptions [ 'class' ] ; if ( is_a ( $ classname , LoggerInterface :: class , true ) ) { if ( isset ( $ loggerOptions [ 'options' ] ) ) { $ logger = new $ classname ( $ loggerOptions [ 'options' ] ) ; } else { $ logger = new $ classname ( ) ; } } } } if ( ! is_null ( $ logger ) ) { $ this -> logger = $ logger ; } else { $ this -> logger = new NullLogger ( ) ; } return $ this -> logger ; }
Load the logger from configuration

If options does not contain any Psr3 Logger, NullLogger is set by default

@return LoggerInterface
Load the logger from configuration