Module: Honeybadger

Extended by:
Forwardable, Honeybadger
Included in:
Honeybadger
Defined in:
lib/honeybadger/init/rake.rb,
lib/honeybadger/cli.rb,
lib/honeybadger/agent.rb,
lib/honeybadger/const.rb,
lib/honeybadger/config.rb,
lib/honeybadger/notice.rb,
lib/honeybadger/plugin.rb,
lib/honeybadger/worker.rb,
lib/honeybadger/backend.rb,
lib/honeybadger/logging.rb,
lib/honeybadger/version.rb,
lib/honeybadger/cli/exec.rb,
lib/honeybadger/cli/main.rb,
lib/honeybadger/cli/test.rb,
lib/honeybadger/backtrace.rb,
lib/honeybadger/singleton.rb,
lib/honeybadger/util/http.rb,
lib/honeybadger/cli/deploy.rb,
lib/honeybadger/cli/heroku.rb,
lib/honeybadger/cli/notify.rb,
lib/honeybadger/config/env.rb,
lib/honeybadger/init/rails.rb,
lib/honeybadger/util/stats.rb,
lib/honeybadger/cli/helpers.rb,
lib/honeybadger/cli/install.rb,
lib/honeybadger/config/ruby.rb,
lib/honeybadger/config/yaml.rb,
lib/honeybadger/backend/base.rb,
lib/honeybadger/backend/null.rb,
lib/honeybadger/backend/test.rb,
lib/honeybadger/init/sinatra.rb,
lib/honeybadger/plugins/thor.rb,
lib/honeybadger/backend/debug.rb,
lib/honeybadger/plugins/rails.rb,
lib/honeybadger/util/revision.rb,
lib/honeybadger/backend/server.rb,
lib/honeybadger/plugins/resque.rb,
lib/honeybadger/plugins/warden.rb,
lib/honeybadger/util/sanitizer.rb,
lib/honeybadger/config/defaults.rb,
lib/honeybadger/context_manager.rb,
lib/honeybadger/plugins/sidekiq.rb,
lib/honeybadger/plugins/passenger.rb,
lib/honeybadger/plugins/shoryuken.rb,
lib/honeybadger/util/request_hash.rb,
lib/honeybadger/rack/user_feedback.rb,
lib/honeybadger/rack/user_informer.rb,
lib/honeybadger/plugins/delayed_job.rb,
lib/honeybadger/rack/error_notifier.rb,
lib/honeybadger/plugins/sucker_punch.rb,
lib/honeybadger/util/request_payload.rb,
lib/honeybadger/plugins/local_variables.rb,
lib/honeybadger/plugins/delayed_job/plugin.rb

Overview

The Singleton module includes the public API for Honeybadger which can be accessed via the global agent (i.e. `Honeybadger.notify`) or via instances of the `Honeybadger::Agent` class.

Defined Under Namespace

Modules: Backend, CLI, Init, Logging, Plugins, Rack, RakeHandler, Util Classes: Agent, Backtrace, Config, ContextManager, Notice, Plugin, Worker

Constant Summary collapse

NOTIFIER =

Internal: The notifier information, included in the JSON payload.

{
  name: 'honeybadger-ruby'.freeze,
  url: 'https://github.com/honeybadger-io/honeybadger-ruby'.freeze,
  version: VERSION,
  language: 'ruby'.freeze
}.freeze
GEM_ROOT =

Internal: Substitution for gem root in backtrace lines.

'[GEM_ROOT]'.freeze
PROJECT_ROOT =

Internal: Substitution for project root in backtrace lines.

'[PROJECT_ROOT]'.freeze
STRING_EMPTY =

Internal: Empty String (used for equality comparisons and assignment).

''.freeze
NOT_BLANK =

Internal: A Regexp which matches non-blank characters.

/\S/.freeze
RELATIVE_ROOT =

Internal: Matches lines beginning with ./

Regexp.new('^\.\/').freeze
MAX_EXCEPTION_CAUSES =

Internal: The maximum number of nested causes to report.

5
VERSION =

Public: The current String Honeybadger version.

'3.1.2'.freeze

Instance Method Summary collapse

Instance Method Details

#load_plugins!Object


19
20
21
22
23
24
# File 'lib/honeybadger/singleton.rb', line 19

def load_plugins!
  Dir[File.expand_path('../plugins/*.rb', __FILE__)].each do |plugin|
    require plugin
  end
  Plugin.load!(self.config)
end

#notify(exception_or_opts, opts = {}) ⇒ Object


15
16
17
# File 'lib/honeybadger/singleton.rb', line 15

def notify(exception_or_opts, opts = {})
  Agent.instance.notify(exception_or_opts, opts)
end

#start(config = {}) ⇒ Object

Deprecated

Raises:

  • (NoMethodError)

27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/honeybadger/singleton.rb', line 27

def start(config = {})
  raise NoMethodError, <<-WARNING
`Honeybadger.start` is no longer necessary and has been removed.

Use `Honeybadger.configure` to explicitly configure the agent from Ruby moving forward:

Honeybadger.configure do |config|
  config.api_key = 'project api key'
  config.exceptions.ignore += [CustomError]
end

See https://git.io/v1Sd4 for documentation.
WARNING
end