Sha256: ddee63a806d9db996a4768447cce44755dd5d3591b9068ffec1f8ddcec185233

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

require 'forwardable'
require 'honeybadger/agent'

# 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.
module Honeybadger
  extend Forwardable
  extend self

  def_delegators :'Honeybadger::Agent.instance', :init!, :config, :configure,
    :context, :get_context, :flush, :stop, :with_rack_env, :exception_filter,
    :exception_fingerprint, :backtrace_filter

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

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

  # Deprecated
  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
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
honeybadger-3.1.2 lib/honeybadger/singleton.rb
honeybadger-3.1.1 lib/honeybadger/singleton.rb
honeybadger-3.1.0 lib/honeybadger/singleton.rb
honeybadger-3.0.2 lib/honeybadger/singleton.rb
honeybadger-3.0.1 lib/honeybadger/singleton.rb
honeybadger-3.0.0 lib/honeybadger/singleton.rb
honeybadger-3.0.0.beta6 lib/honeybadger/singleton.rb
honeybadger-3.0.0.beta5 lib/honeybadger/singleton.rb
honeybadger-3.0.0.beta4 lib/honeybadger/singleton.rb