lib/unleash/configuration.rb in unleash-4.3.0 vs lib/unleash/configuration.rb in unleash-4.4.0

- old
+ new

@@ -18,11 +18,12 @@ :refresh_interval, :metrics_interval, :backup_file, :logger, :log_level, - :bootstrap_config + :bootstrap_config, + :strategies def initialize(opts = {}) validate_custom_http_headers!(opts[:custom_http_headers]) if opts.has_key?(:custom_http_headers) set_defaults @@ -49,11 +50,12 @@ end def http_headers { 'UNLEASH-INSTANCEID' => self.instance_id, - 'UNLEASH-APPNAME' => self.app_name + 'UNLEASH-APPNAME' => self.app_name, + 'Unleash-Client-Spec' => '4.2.2' }.merge!(generate_custom_http_headers) end def fetch_toggles_uri uri = URI("#{self.url_stripped_of_slash}/client/features") @@ -92,15 +94,16 @@ self.timeout = 30 self.retry_limit = Float::INFINITY self.backup_file = nil self.log_level = Logger::WARN self.bootstrap_config = nil + self.strategies = Unleash::Strategies.new self.custom_http_headers = {} end def initialize_default_logger - self.logger = Logger.new(STDOUT) + self.logger = Logger.new($stdout) # on default logger, use custom formatter that includes thread_name: self.logger.formatter = proc do |severity, datetime, _progname, msg| thread_name = (Thread.current[:name] || "Unleash").rjust(16, ' ') "[#{datetime.iso8601(6)} #{thread_name} #{severity.ljust(5, ' ')}] : #{msg}\n"