lib/semantic_logger/formatters/signalfx.rb in semantic_logger-4.3.1 vs lib/semantic_logger/formatters/signalfx.rb in semantic_logger-4.4.0
- old
+ new
@@ -8,23 +8,24 @@
dimensions: nil,
log_host: true,
log_application: true,
gauge_name: 'Application.average',
counter_name: 'Application.counter',
- environment: true)
+ environment: true,
+ precision: PRECISION)
@token = token
@dimensions = dimensions.map(&:to_sym) if dimensions
@gauge_name = gauge_name
@counter_name = counter_name
if environment == true
- @environment = defined?(Rails) ? Rails.env : ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
+ @environment = defined?(Rails) && Rails.respond_to?(:env) ? Rails.env : ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
elsif environment
@environment = environment
end
- super(time_format: :ms, log_host: log_host, log_application: log_application)
+ super(time_format: :ms, log_host: log_host, log_application: log_application, precision: precision)
end
# Create SignalFx friendly metric.
# Strip leading '/'
# Convert remaining '/' to '.'