# File src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb, line 85
    def sanitize_spawn_options(options)
      defaults = {
        "app_type"         => "rack",
        "environment"      => "production",
        "print_exceptions" => true
      }
      options = defaults.merge(options)
      options["app_group_name"]            = options["app_root"] if !options["app_group_name"]
      options["print_exceptions"]          = to_boolean(options["print_exceptions"])
      options["analytics"]                 = to_boolean(options["analytics"])
      options["show_version_in_header"]    = to_boolean(options["show_version_in_header"])
      options["log_level"]                 = options["log_level"].to_i if options["log_level"]
      # TODO: smart spawning is not supported when using ruby-debug. We should raise an error
      # in this case.
      options["debugger"]     = to_boolean(options["debugger"])
      options["spawn_method"] = "direct" if options["debugger"]

      return options
    end