lib/tracer_client/log.rb in tracer_client-0.2.1 vs lib/tracer_client/log.rb in tracer_client-0.3.0
- old
+ new
@@ -130,10 +130,11 @@
exception.mark_logged
end
def self.log?(severity)
- Settings.log.severity_level.nil? || enabled_severity?(severity, Settings.log.severity_level)
+ (Rails.env.production? && !ENV['NO_TRACER'].to_b || ENV['TRACER'].to_b) &&
+ (Settings.log.severity_level.nil? || enabled_severity?(severity, Settings.log.severity_level))
end
def self.enabled_severity?(message_severity, configured_severity)
message_index = SEVERITIES.index(message_severity)
configured_index = SEVERITIES.index(configured_severity.to_sym)