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;
        }
    }