Module: Airbrake
- Defined in:
- lib/airbrake-ruby.rb,
lib/airbrake-ruby/config.rb,
lib/airbrake-ruby/notice.rb,
lib/airbrake-ruby/filters.rb,
lib/airbrake-ruby/version.rb,
lib/airbrake-ruby/notifier.rb,
lib/airbrake-ruby/response.rb,
lib/airbrake-ruby/backtrace.rb,
lib/airbrake-ruby/sync_sender.rb,
lib/airbrake-ruby/async_sender.rb,
lib/airbrake-ruby/filter_chain.rb,
lib/airbrake-ruby/payload_truncator.rb,
lib/airbrake-ruby/filters/keys_filter.rb,
lib/airbrake-ruby/filters/keys_blacklist.rb,
lib/airbrake-ruby/filters/keys_whitelist.rb
Overview
Defines version.
Defined Under Namespace
Modules: Backtrace, Filters, Response Classes: AsyncSender, Config, FilterChain, Notice, Notifier, PayloadTruncator, SyncSender
Constant Summary collapse
- Error =
The general error that this library uses when it wants to raise.
Class.new(StandardError)
- LOG_LABEL =
'**Airbrake:'.freeze
- AIRBRAKE_RUBY_VERSION =
'1.0.1'.freeze
Class Method Summary collapse
-
.add_filter(filter = nil, notifier = :default) {|notice| ... } ⇒ void
Runs a callback before Airbrake.notify or Airbrake.notify_sync kicks in.
-
.blacklist_keys(keys, notifier = :default) ⇒ void
Specifies which keys should be filtered.
-
.build_notice(exception, params = {}, notifier = :default) ⇒ Airbrake::Notice
Builds an Airbrake notice.
-
.close(notifier = :default) ⇒ void
Makes the notifier a no-op, which means you cannot use the Airbrake.notify and Airbrake.notify_sync methods anymore.
-
.configure(notifier = :default) {|config| ... } ⇒ void
Configures a new
notifierwith the given name. -
.create_deploy(deploy_params, notifier = :default) ⇒ Object
private
Pings the Airbrake Deploy API endpoint about the occurred deploy.
-
.notify(exception, params = {}, notifier = :default) ⇒ nil
Sends an exception to Airbrake asynchronously.
-
.notify_sync(exception, params = {}, notifier = :default) ⇒ Hash{String=>String}
Sends an exception to Airbrake synchronously.
-
.whitelist_keys(keys, notifier = :default) ⇒ void
Specifies which keys should not be filtered.
Class Method Details
.add_filter(filter = nil, notifier = :default) {|notice| ... } ⇒ void
Once a filter was added, there’s no way to delete it
This method returns an undefined value.
Runs a callback before notify or notify_sync kicks in. This is useful if you want to ignore specific notices or filter the data the notice contains.
180 181 182 |
# File 'lib/airbrake-ruby.rb', line 180 def add_filter(filter = nil, notifier = :default, &block) call_notifier(notifier, __method__, filter, &block) end |
.blacklist_keys(keys, notifier = :default) ⇒ void
This method returns an undefined value.
Specifies which keys should be filtered. Such keys will be replaced with the [Filtered] label.
214 215 216 |
# File 'lib/airbrake-ruby.rb', line 214 def blacklist_keys(keys, notifier = :default) call_notifier(notifier, __method__, keys) end |
.build_notice(exception, params = {}, notifier = :default) ⇒ Airbrake::Notice
Builds an Airbrake notice. This is useful, if you want to add or modify a value only for a specific notice. When you’re done modifying the notice, send it with notify or notify_sync.
235 236 237 |
# File 'lib/airbrake-ruby.rb', line 235 def build_notice(exception, params = {}, notifier = :default) call_notifier(notifier, __method__, exception, params) end |
.close(notifier = :default) ⇒ void
This method returns an undefined value.
Makes the notifier a no-op, which means you cannot use the notify and notify_sync methods anymore. It also stops the notifier’s worker threads.
251 252 253 |
# File 'lib/airbrake-ruby.rb', line 251 def close(notifier = :default) call_notifier(notifier, __method__) end |
.configure(notifier = :default) {|config| ... } ⇒ void
There’s no way to reconfigure a notifier
There’s no way to read config values outside of this library
This method returns an undefined value.
Configures a new notifier with the given name. If the name is not given, configures the default notifier.
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/airbrake-ruby.rb', line 97 def configure(notifier = :default) yield config = Airbrake::Config.new if @notifiers.key?(notifier) raise Airbrake::Error, "the '#{notifier}' notifier was already configured" else @notifiers[notifier] = Notifier.new(config) end end |
.create_deploy(deploy_params, notifier = :default) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Pings the Airbrake Deploy API endpoint about the occurred deploy. This method is used by the airbrake gem for various integrations.
268 269 270 |
# File 'lib/airbrake-ruby.rb', line 268 def create_deploy(deploy_params, notifier = :default) call_notifier(notifier, __method__, deploy_params) end |
.notify(exception, params = {}, notifier = :default) ⇒ nil
Sends an exception to Airbrake asynchronously.
133 134 135 |
# File 'lib/airbrake-ruby.rb', line 133 def notify(exception, params = {}, notifier = :default) call_notifier(notifier, __method__, exception, params) end |
.notify_sync(exception, params = {}, notifier = :default) ⇒ Hash{String=>String}
Sends an exception to Airbrake synchronously.
148 149 150 |
# File 'lib/airbrake-ruby.rb', line 148 def notify_sync(exception, params = {}, notifier = :default) call_notifier(notifier, __method__, exception, params) end |
.whitelist_keys(keys, notifier = :default) ⇒ void
This method returns an undefined value.
Specifies which keys should not be filtered. All other keys will be substituted with the [Filtered] label.
197 198 199 |
# File 'lib/airbrake-ruby.rb', line 197 def whitelist_keys(keys, notifier = :default) call_notifier(notifier, __method__, keys) end |