# frozen_string_literal: true # This Railtie runs some initializers that will set the logger to Rails#logger, # and will initialize the {StatsD#backend} based on the Rails environment. # # @see StatsD::Instrument::Environment class StatsD::Instrument::Railtie < Rails::Railtie initializer 'statsd-instrument.use_rails_logger' do ::StatsD.logger = Rails.logger end initializer 'statsd-instrument.setup_backend', after: 'statsd-instrument.use_rails_logger' do ::StatsD.backend = ::StatsD::Instrument::Environment.default_backend end end