Module: Logcast

Defined in:
lib/logcast.rb,
lib/logcast/rails.rb

Defined Under Namespace

Classes: Broadcaster, Railtie

Class Method Summary collapse

Class Method Details

.engage!Object


4
5
6
7
8
9
10
11
12
13
14
# File 'lib/logcast.rb', line 4

def self.engage!
  class << Rails
    alias_method(:old_logger=, :logger=)

    def logger=(logger)
      broadcast = Logcast::Broadcaster.new
      broadcast.subscribe(logger)
      self.old_logger = broadcast
    end
  end
end