module Squash::Ruby

Extend SquashNotifier with Rails support

Public Class Methods

client_name() click to toggle source
# File lib/exception_notifier/squash_ruby/rails.rb, line 12
def client_name
  'squash-notifier-rails'
end
failsafe_log(tag, message) click to toggle source
# File lib/exception_notifier/squash_ruby/rails.rb, line 16
def failsafe_log(tag, message)
  logger = Rails.respond_to?(:logger) ? Rails.logger : RAILS_DEFAULT_LOGGER
  if (logger.respond_to?(:tagged))
    logger.tagged(tag) { logger.error message }
  else
    logger.error "[#{tag}]\t#{message}"
  end
rescue Object => err
  $stderr.puts "Couldn't write to failsafe log (#{err.to_s}); writing to stderr instead."
  $stderr.puts "#{Time.now.to_s}\t[#{tag}]\t#{message}"
end

Private Class Methods

environment_data() click to toggle source
# File lib/exception_notifier/squash_ruby/ruby.rb, line 17
def environment_data
  no_filtering = lambda {|val| val }
  filter_env_vars = configuration(:filter_env_vars) || no_filtering
  filter_argv = configuration(:filter_argv) || no_filtering

  ev_orig = environment_data__original
  ev_orig.merge({
    'env_vars' => filter_env_vars.call(ev_orig['env_vars']),  # The original "valueifies" ENV for us
    'arguments' => filter_argv.call(ARGV).join(' ')  # The original munges into a string, which is less-easy to filter
  })
end
Also aliased as: environment_data__original
environment_data__original()
Alias for: environment_data