class Honeybadger::Config::Ruby
Public Instance Methods
Source
# File lib/honeybadger/config/ruby.rb, line 85 def backend get(:backend) || config.backend end
Source
# File lib/honeybadger/config/ruby.rb, line 81 def backend=(backend) hash[:backend] = backend end
Source
# File lib/honeybadger/config/ruby.rb, line 113 def backtrace_filter(&block) if block_given? logger.warn('DEPRECATED: backtrace_filter is deprecated. Please use before_notify instead. See https://docs.honeybadger.io/ruby/support/v4-upgrade#backtrace_filter') hash[:backtrace_filter] = block if block_given? end get(:backtrace_filter) end
Source
# File lib/honeybadger/config/ruby.rb, line 101 def before_event(action = nil, &block) hooks = Array(get(:before_event)).dup if action && validate_before_action(action, 'event') hooks << action elsif block_given? && validate_before_action(block, 'event') hooks << block end hash[:before_event] = hooks end
Source
# File lib/honeybadger/config/ruby.rb, line 89 def before_notify(action = nil, &block) hooks = Array(get(:before_notify)).dup if action && validate_before_action(action, 'notify') hooks << action elsif block_given? && validate_before_action(block, 'notify') hooks << block end hash[:before_notify] = hooks end
Source
# File lib/honeybadger/config/ruby.rb, line 122 def exception_filter(&block) if block_given? logger.warn('DEPRECATED: exception_filter is deprecated. Please use before_notify instead. See https://docs.honeybadger.io/ruby/support/v4-upgrade#exception_filter') hash[:exception_filter] = block end get(:exception_filter) end
Source
# File lib/honeybadger/config/ruby.rb, line 131 def exception_fingerprint(&block) if block_given? logger.warn('DEPRECATED: exception_fingerprint is deprecated. Please use before_notify instead. See https://docs.honeybadger.io/ruby/support/v4-upgrade#exception_fingerprint') hash[:exception_fingerprint] = block end get(:exception_fingerprint) end
Source
# File lib/honeybadger/config/ruby.rb, line 77 def logger get(:logger) || config.logger end
Source
# File lib/honeybadger/config/ruby.rb, line 73 def logger=(logger) hash[:logger] = logger end
Private Instance Methods
Source
# File lib/honeybadger/config/ruby.rb, line 142 def validate_before_action(action, type) if !action.respond_to?(:call) logger.warn( "You attempted to add a before #{type} hook that does not respond " \ 'to #call. We are discarding this hook so your intended behavior ' \ 'will not occur.' ) false elsif action.arity != 1 logger.warn( "You attempted to add a before #{type} hook that has an arity " \ 'other than one. We are discarding this hook so your intended ' \ 'behavior will not occur.' ) false else true end end