def level_to_index(level)
      return if level.nil?

      case level
      when Symbol
        LEVELS.index(level)
      when String
        LEVELS.index(level.downcase.to_sym)
      when Integer
        map_levels[level] || fail_with_unkown_log_level!(level)
      else
        fail_with_unkown_log_level!(level)
      end
    end
def level_to_index(level)
      return if level.nil?

      case level
      when Symbol
        LEVELS.index(level)
      when String
        LEVELS.index(level.downcase.to_sym)
      when Integer
        map_levels[level] || fail_with_unkown_log_level!(level)
      else
        fail_with_unkown_log_level!(level)
      end
    end
Internal method to return the log level as an internal index
 Also supports mapping the ::Logger levels to Sapience levels