These known level should be defined in a constant, then you can do:

    raise [..] unless LOG_LEVELS.include? level