Module: Rnotifier
- Defined in:
- lib/rnotifier.rb,
lib/rnotifier/config.rb,
lib/rnotifier/railtie.rb,
lib/rnotifier/rlogger.rb,
lib/rnotifier/version.rb,
lib/rnotifier/notifier.rb,
lib/rnotifier/event_data.rb,
lib/rnotifier/config_test.rb,
lib/rnotifier/exception_code.rb,
lib/rnotifier/exception_data.rb,
lib/rnotifier/rack_middleware.rb,
lib/rnotifier/parameter_filter.rb
Defined Under Namespace
Classes: Config, ConfigTest, EventData, ExceptionCode, ExceptionData, Notifier, ParameterFilter, RackMiddleware, Railtie, Rlogger
Constant Summary
collapse
- VERSION =
"0.1.5"
Class Method Summary
collapse
Class Method Details
.alert(name, params, tags = {}) ⇒ Object
.clear_context ⇒ Object
45
46
47
|
# File 'lib/rnotifier.rb', line 45
def clear_context
Thread.current[:rnotifier_context] = nil
end
|
.config {|Rnotifier::Config| ... } ⇒ Object
.context(attrs = {}) ⇒ Object
37
38
39
40
41
42
43
|
# File 'lib/rnotifier.rb', line 37
def context(attrs = {})
if Thread.current[:rnotifier_context]
Thread.current[:rnotifier_context].merge!(attrs)
else
Thread.current[:rnotifier_context] = attrs
end
end
|
.event(name, params, tags = {}) ⇒ Object
.exception(exception, params = {}) ⇒ Object
49
50
51
|
# File 'lib/rnotifier.rb', line 49
def exception(exception, params = {})
Rnotifier::ExceptionData.new(exception, params, {:type => :rescue}).notify
end
|
.load_config(file) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/rnotifier.rb', line 25
def load_config(file)
config_yaml = YAML.load_file(file)
self.config do |c|
c.api_key = config_yaml['apikey']
['environments', 'api_host', 'ignore_exceptions', 'ignore_bots', 'capture_code'].each do |f|
c.send("#{f}=", config_yaml[f]) if config_yaml[f]
end
end
end
|