Module: Faultline

Defined in:
lib/faultline.rb,
lib/faultline/config.rb,
lib/faultline/notice.rb,
lib/faultline/version.rb,
lib/faultline/notifier.rb,
lib/faultline/sync_sender.rb,
lib/faultline/async_sender.rb,
lib/faultline/config/validator.rb

Defined Under Namespace

Classes: AsyncSender, Config, NilNotifier, Notice, Notifier, SyncSender

Constant Summary collapse

Error =
Class.new(StandardError)
LOG_LABEL =
'**Faultline:'.freeze
RUBY_20 =
RUBY_VERSION.start_with?('2.0')
VERSION =
'0.2.0'.freeze

Class Method Summary collapse

Class Method Details

.[](notifier_name) ⇒ Object



34
35
36
# File 'lib/faultline.rb', line 34

def [](notifier_name)
  @notifiers[notifier_name]
end

.add_filter(filter = nil, &block) ⇒ Object



57
58
59
# File 'lib/faultline.rb', line 57

def add_filter(filter = nil, &block)
  @notifiers[:default].add_filter(filter, &block)
end

.build_notice(exception, params = {}) ⇒ Object



61
62
63
# File 'lib/faultline.rb', line 61

def build_notice(exception, params = {})
  @notifiers[:default].build_notice(exception, params)
end

.closeObject



65
66
67
# File 'lib/faultline.rb', line 65

def close
  @notifiers[:default].close
end

.configure(notifier_name = :default) {|config = Faultline::Config.new| ... } ⇒ Object

Yields:



38
39
40
41
42
43
44
45
46
47
# File 'lib/faultline.rb', line 38

def configure(notifier_name = :default)
  yield config = Faultline::Config.new

  if @notifiers.key?(notifier_name)
    raise Airbrake::Error,
          "the '#{notifier_name}' notifier was already configured"
  else
    @notifiers[notifier_name] = Notifier.new(config)
  end
end

.create_deploy(deploy_params) ⇒ Object



69
70
71
# File 'lib/faultline.rb', line 69

def create_deploy(deploy_params)
  @notifiers[:default].create_deploy(deploy_params)
end

.notify(exception, params = {}) ⇒ Object



49
50
51
# File 'lib/faultline.rb', line 49

def notify(exception, params = {})
  @notifiers[:default].notify(exception, params)
end

.notify_sync(exception, params = {}) ⇒ Object



53
54
55
# File 'lib/faultline.rb', line 53

def notify_sync(exception, params = {})
  @notifiers[:default].notify_sync(exception, params)
end