lib/elastic_apm/agent.rb in elastic-apm-0.4.5 vs lib/elastic_apm/agent.rb in elastic-apm-0.5.0

- old
+ new

@@ -21,29 +21,28 @@ def self.instance # rubocop:disable Style/TrivialAccessors @instance end - # rubocop:disable Metrics/MethodLength - def self.start(config) + def self.start(config) # rubocop:disable Metrics/MethodLength return @instance if @instance - config = Config.new(config) if config.is_a?(Hash) + config = Config.new(config) unless config.is_a?(Config) unless config.enabled_environments.include?(config.environment) - config.logger && config.logger.info( - format('Not tracking anything in "%s" env', config.environment) + puts format( + '%sNot tracking anything in "%s" env', + Log::PREFIX, config.environment ) return end LOCK.synchronize do return @instance if @instance - @instance = new(config.freeze).start + @instance = new(config).start end end - # rubocop:enable Metrics/MethodLength def self.stop LOCK.synchronize do return unless @instance