Class: VWO::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/vwo/logger.rb

Constant Summary collapse

DEBUG =
::Logger::DEBUG
INFO =
::Logger::INFO
ERROR =
::Logger::ERROR
WARN =
::Logger::WARN

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger_instance) ⇒ Logger

Returns a new instance of Logger.



31
32
33
# File 'lib/vwo/logger.rb', line 31

def initialize(logger_instance)
  @@logger_instance = logger_instance || ::Logger.new($stdout)
end

Class Method Details

.get_instance(logger_instance = nil) ⇒ Object



27
28
29
# File 'lib/vwo/logger.rb', line 27

def self.get_instance(logger_instance = nil)
  @@logger ||= VWO::Logger.new(logger_instance)
end

Instance Method Details

#instanceObject



40
41
42
# File 'lib/vwo/logger.rb', line 40

def instance
  @@logger_instance
end

#levelObject



44
45
46
# File 'lib/vwo/logger.rb', line 44

def level
  @@logger_instance.level
end

#log(level, message) ⇒ Object

Override this method to handle logs in a custom manner



36
37
38
# File 'lib/vwo/logger.rb', line 36

def log(level, message)
  @@logger_instance.log(level, message)
end