private function needToLog(string $level): bool
    {
        $logLevels = [LogLevel::EMERGENCY => 0,
                      LogLevel::ALERT     => 1,
                      LogLevel::CRITICAL  => 2,
                      LogLevel::ERROR     => 3,
                      LogLevel::WARNING   => 4,
                      LogLevel::NOTICE    => 5,
                      LogLevel::INFO      => 6,
                      LogLevel::DEBUG     => 7];

        if (isset($logLevels[$this->getApp()->getConfig()->getLogLevel()])) {
            return isset($logLevels[$level]) && $logLevels[$level] <= $logLevels[$this->getApp()->getConfig()->getLogLevel()];
        } else {
            return false;
        }
    }
private function needToLog(string $level): bool
    {
        $logLevels = [LogLevel::EMERGENCY => 0,
                      LogLevel::ALERT     => 1,
                      LogLevel::CRITICAL  => 2,
                      LogLevel::ERROR     => 3,
                      LogLevel::WARNING   => 4,
                      LogLevel::NOTICE    => 5,
                      LogLevel::INFO      => 6,
                      LogLevel::DEBUG     => 7];

        if (isset($logLevels[$this->getApp()->getConfig()->getLogLevel()])) {
            return isset($logLevels[$level]) && $logLevels[$level] <= $logLevels[$this->getApp()->getConfig()->getLogLevel()];
        } else {
            return false;
        }
    }
private function needToLog ( string $ level ) : bool { $ logLevels = [ LogLevel :: EMERGENCY => 0 , LogLevel :: ALERT => 1 , LogLevel :: CRITICAL => 2 , LogLevel :: ERROR => 3 , LogLevel :: WARNING => 4 , LogLevel :: NOTICE => 5 , LogLevel :: INFO => 6 , LogLevel :: DEBUG => 7 ] ; if ( isset ( $ logLevels [ $ this -> getApp ( ) -> getConfig ( ) -> getLogLevel ( ) ] ) ) { return isset ( $ logLevels [ $ level ] ) && $ logLevels [ $ level ] <= $ logLevels [ $ this -> getApp ( ) -> getConfig ( ) -> getLogLevel ( ) ] ; } else { return false ; } }
Need to log ?

@param string $level

@return bool
Need to log ?