Module: Rudder::Analytics::Logging

Included in:
Rudder::Analytics, Client, MessageBatch, Request, Worker
Defined in:
lib/rudder/analytics/logging.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.loggerObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rudder/analytics/logging.rb', line 31

def logger
  return @logger if @logger

  base_logger = if defined?(Rails)
                  Rails.logger
                else
                  logger = Logger.new STDOUT
                  logger.progname = 'Rudder::Analytics'
                  logger
                end
  @logger = PrefixedLogger.new(base_logger, '[rudderanalytics-ruby]')
end

Class Method Details

.included(base) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/rudder/analytics/logging.rb', line 47

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

Instance Method Details

#loggerObject



55
56
57
# File 'lib/rudder/analytics/logging.rb', line 55

def logger
  Logging.logger
end