Class: Emque::Producing::Logging

Inherits:
Object
  • Object
show all
Defined in:
lib/emque/producing/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initialize_logger(log_target = STDOUT) ⇒ Object



6
7
8
9
10
# File 'lib/emque/producing/logging.rb', line 6

def self.initialize_logger(log_target = STDOUT)
  @logger = Logger.new(log_target)
  @logger.level = Logger::INFO
  @logger
end

.loggerObject



12
13
14
# File 'lib/emque/producing/logging.rb', line 12

def self.logger
  defined?(@logger) ? @logger : initialize_logger
end

.logger=(log) ⇒ Object



16
17
18
# File 'lib/emque/producing/logging.rb', line 16

def self.logger=(log)
  @logger = log || Logger.new("/dev/null")
end

Instance Method Details

#loggerObject



20
21
22
# File 'lib/emque/producing/logging.rb', line 20

def logger
  Emque::Producing::Logging.logger
end