Module: ActiveSupportBroadcastLogger::Chain

Defined in:
lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instrument!Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb', line 7

def self.instrument!
  ::ActiveSupportBroadcastLogger.class_eval do
    include NewRelic::Agent::Instrumentation::ActiveSupportBroadcastLogger

    alias_method(:add_without_new_relic, :add)

    def add(*args, &task)
      record_one_broadcast_with_new_relic(*args) do
        add_without_new_relic(*args, &traced_task)
      end
    end

    alias_method(:debug_without_new_relic, :debug)

    def debug(*args, &task)
      record_one_broadcast_with_new_relic(*args) do
        debug_without_new_relic(*args, &traced_task)
      end
    end

    alias_method(:info_without_new_relic, :info)

    def info(*args, &task)
      record_one_broadcast_with_new_relic(*args) do
        info_without_new_relic(*args, &traced_task)
      end
    end

    alias_method(:warn_without_new_relic, :warn)

    def warn(*args, &task)
      record_one_broadcast_with_new_relic(*args) do
        warn_without_new_relic(*args, &traced_task)
      end
    end

    alias_method(:error_without_new_relic, :error)

    def error(*args, &task)
      record_one_broadcast_with_new_relic(*args) do
        error_without_new_relic(*args, &traced_task)
      end
    end

    alias_method(:fatal_without_new_relic, :fatal)

    def fatal(*args, &task)
      record_one_broadcast_with_new_relic(*args) do
        fatal_without_new_relic(*args, &traced_task)
      end
    end
  end

  alias_method(:unknown_without_new_relic, :unknown)

  def unknown(*args, &task)
    record_one_broadcast_with_new_relic(*args) do
      unknown_without_new_relic(*args, &traced_task)
    end
  end
end

Instance Method Details

#unknown(*args, &task) ⇒ Object



62
63
64
65
66
# File 'lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb', line 62

def unknown(*args, &task)
  record_one_broadcast_with_new_relic(*args) do
    unknown_without_new_relic(*args, &traced_task)
  end
end