Module: ErrorRadar
- Defined in:
- lib/error_radar.rb,
lib/error_radar/engine.rb,
lib/error_radar/version.rb,
lib/error_radar/tracking.rb,
lib/error_radar/middleware.rb,
lib/error_radar/configuration.rb,
lib/error_radar/server_monitor.rb,
app/models/error_radar/error_log.rb,
lib/error_radar/integrations/sidekiq.rb,
lib/error_radar/integrations/active_job.rb,
lib/error_radar/integrations/rails_admin.rb,
app/models/error_radar/application_record.rb,
app/controllers/error_radar/dashboard_controller.rb,
app/controllers/error_radar/application_controller.rb,
lib/generators/error_radar/install/install_generator.rb
Overview
Public entry point for the gem.
ErrorRadar.configure do |c|
c.authenticate = ->(controller) { controller.send(:authenticate_admin!) }
c.current_user = ->(controller) { controller.current_admin&.email }
end
ErrorRadar.capture(exception, source: 'SomeJob', context: { post_id: 1 })
ErrorRadar.notify('Custom problem', category: :external_api, severity: :warning)
ErrorRadar.monitor('NightlyRakeTask') { do_work }
Defined Under Namespace
Modules: Generators, Integrations, Tracking
Classes: ApplicationController, ApplicationRecord, Configuration, DashboardController, Engine, ErrorLog, Middleware, ServerMonitor
Constant Summary
collapse
- VERSION =
'0.1.0'
Class Method Summary
collapse
Class Method Details
.capture(exception, **kwargs) ⇒ Object
35
36
37
|
# File 'lib/error_radar.rb', line 35
def capture(exception, **kwargs)
Tracking.capture(exception, **kwargs)
end
|
.config ⇒ Object
22
23
24
|
# File 'lib/error_radar.rb', line 22
def config
@config ||= Configuration.new
end
|
26
27
28
|
# File 'lib/error_radar.rb', line 26
def configure
yield config
end
|
.monitor(source, **kwargs, &block) ⇒ Object
43
44
45
|
# File 'lib/error_radar.rb', line 43
def monitor(source, **kwargs, &block)
Tracking.monitor(source, **kwargs, &block)
end
|
.notify(message, **kwargs) ⇒ Object
39
40
41
|
# File 'lib/error_radar.rb', line 39
def notify(message, **kwargs)
Tracking.notify(message, **kwargs)
end
|
.reset_config! ⇒ Object
Reset configuration — mostly useful in tests.
31
32
33
|
# File 'lib/error_radar.rb', line 31
def reset_config!
@config = Configuration.new
end
|