Module: Segment::Analytics::Logging

Included in:
Segment::Analytics, Request
Defined in:
lib/segment/analytics/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/segment/analytics/logging.rb', line 22

def self.included base
  class << base
    def logger
      Logging.logger
    end
  end
end

.loggerObject



7
8
9
10
11
12
13
14
15
# File 'lib/segment/analytics/logging.rb', line 7

def logger
  @logger ||= if defined?(Rails)
                Rails.logger
              else
                logger = Logger.new STDOUT
                logger.progname = 'Segment::Analytics'
                logger
              end
end

.logger=(logger) ⇒ Object



17
18
19
# File 'lib/segment/analytics/logging.rb', line 17

def logger= logger
  @logger = logger
end

Instance Method Details

#loggerObject



30
31
32
# File 'lib/segment/analytics/logging.rb', line 30

def logger
  Logging.logger
end