Module: ActionReporter

Defined in:
lib/action_reporter.rb,
lib/action_reporter/base.rb,
lib/action_reporter/error.rb,
lib/action_reporter/utils.rb,
lib/action_reporter/rails_reporter.rb,
lib/action_reporter/sentry_reporter.rb,
lib/action_reporter/audited_reporter.rb,
lib/action_reporter/scout_apm_reporter.rb,
lib/action_reporter/honeybadger_reporter.rb,
lib/action_reporter/paper_trail_reporter.rb

Defined Under Namespace

Modules: Utils Classes: AuditedReporter, Base, Error, HoneybadgerReporter, PaperTrailReporter, RailsReporter, ScoutApmReporter, SentryReporter

Constant Summary collapse

VERSION =
'1.5.2'.freeze
AVAILABLE_REPORTERS =
[
  ActionReporter::RailsReporter,
  ActionReporter::HoneybadgerReporter,
  ActionReporter::SentryReporter,
  ActionReporter::ScoutApmReporter,
  ActionReporter::AuditedReporter,
  ActionReporter::PaperTrailReporter
].freeze

Class Method Summary collapse

Class Method Details

.check_in(identifier) ⇒ Object



97
98
99
100
101
102
103
# File 'lib/action_reporter.rb', line 97

def check_in(identifier)
  enabled_reporters.each do |reporter|
    next unless reporter.respond_to?(:check_in)

    reporter.check_in(identifier)
  end
end

.context(args) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/action_reporter.rb', line 42

def context(args)
  enabled_reporters.each do |reporter|
    next unless reporter.respond_to?(:context)

    reporter.context(args)
  end
end

.current_remote_addrObject



84
85
86
# File 'lib/action_reporter.rb', line 84

def current_remote_addr
  @current_remote_addr
end

.current_remote_addr=(remote_addr) ⇒ Object



88
89
90
91
92
93
94
95
# File 'lib/action_reporter.rb', line 88

def current_remote_addr=(remote_addr)
  @current_remote_addr = remote_addr
  enabled_reporters.each do |reporter|
    next unless reporter.respond_to?(:current_remote_addr=)

    reporter.current_remote_addr = remote_addr
  end
end

.current_request_uuidObject



71
72
73
# File 'lib/action_reporter.rb', line 71

def current_request_uuid
  @current_request_uuid
end

.current_request_uuid=(request_uuid) ⇒ Object



75
76
77
78
79
80
81
82
# File 'lib/action_reporter.rb', line 75

def current_request_uuid=(request_uuid)
  @current_request_uuid = request_uuid
  enabled_reporters.each do |reporter|
    next unless reporter.respond_to?(:current_request_uuid=)

    reporter.current_request_uuid = request_uuid
  end
end

.current_userObject



58
59
60
# File 'lib/action_reporter.rb', line 58

def current_user
  @current_user
end

.current_user=(user) ⇒ Object



62
63
64
65
66
67
68
69
# File 'lib/action_reporter.rb', line 62

def current_user=(user)
  @current_user = user
  enabled_reporters.each do |reporter|
    next unless reporter.respond_to?(:current_user=)

    reporter.current_user = user
  end
end

.enabled_reportersObject



30
31
32
# File 'lib/action_reporter.rb', line 30

def enabled_reporters
  @enabled_reporters
end

.enabled_reporters=(reporters) ⇒ Object



26
27
28
# File 'lib/action_reporter.rb', line 26

def enabled_reporters=(reporters)
  @enabled_reporters = reporters
end

.notify(error, context: {}) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/action_reporter.rb', line 34

def notify(error, context: {})
  enabled_reporters.each do |reporter|
    next unless reporter.respond_to?(:notify)

    reporter.notify(error, context: context)
  end
end

.reset_contextObject



50
51
52
53
54
55
56
# File 'lib/action_reporter.rb', line 50

def reset_context
  enabled_reporters.each do |reporter|
    next unless reporter.respond_to?(:reset_context)

    reporter.reset_context
  end
end