lib/new_backup/datadog.rb in new_backup-1.0.3 vs lib/new_backup/datadog.rb in new_backup-1.0.4

- old
+ new

@@ -57,11 +57,11 @@ end def api_key=(api_key) $dogger ||= DataDogger.new $dogger.api_key=api_key - debug "#{self.class}##{__method__}@#{__LINE__}: $dogger.api_key: #{$dogger.api_key}" + debug "#{self.class}##{__method__}@#{File.basename(__FILE__)}:#{__LINE__}: $dogger.api_key: #{$dogger.api_key}" end def dogger(msg, options={}) return if msg.nil? || msg.empty? @@ -69,16 +69,16 @@ if options[:type] == :error error msg else info msg end - debug "#{self.class}##{__method__}@#{__LINE__}: $dogger exists? #{$dogger.inspect}" - debug "#{self.class}##{__method__}@#{__LINE__}: $dogger.api_key: #{$dogger.api_key}" + debug "#{self.class}##{__method__}@#{File.basename(__FILE__)}:#{__LINE__}: $dogger exists? #{$dogger.inspect}" + debug "#{self.class}##{__method__}@#{File.basename(__FILE__)}:#{__LINE__}: $dogger.api_key: #{$dogger.api_key}" return if $dogger.api_key.nil? || $dogger.api_key.empty? $dogger.client ||= Dogapi::Client.new($dogger.api_key) - debug "#{self.class}##{__method__}@#{__LINE__}: $dogger.client: #{$dogger.client.inspect}" + debug "#{self.class}##{__method__}@#{File.basename(__FILE__)}:#{__LINE__}: $dogger.client: #{$dogger.client.inspect}" $dogger.environment ||= (ENV['RAILS_ENV'].nil? || ENV['RAILS_ENV'].empty?) ? 'development' : ENV['RAILS_ENV'] hostname = `hostname`.chomp @@ -91,10 +91,10 @@ :source => 'MyApps'} body = options[:body] ||= msg this_event = Dogapi::Event.new(body, emit_options) - debug "#{self.class}##{__method__}@#{__LINE__}: emit_options: #{emit_options.to_yaml}\nbody: #{body}\nthis_event: #{this_event.inspect}" + debug "#{self.class}##{__method__}@#{File.basename(__FILE__)}:#{__LINE__}: emit_options: #{emit_options.to_yaml}\nbody: #{body}\nthis_event: #{this_event.inspect}" $dogger.client.emit_event(this_event) end end