Class: VWO::CustomLogger

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger_instance) ⇒ CustomLogger

Returns a new instance of CustomLogger.



14
15
16
# File 'lib/vwo/custom_logger.rb', line 14

def initialize(logger_instance)
  @@logger_instance = logger_instance || Logger.new(STDOUT)
end

Class Method Details

.get_instance(logger_instance = nil) ⇒ Object



10
11
12
# File 'lib/vwo/custom_logger.rb', line 10

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

Instance Method Details

#log(level, message) ⇒ Object

Override this method to handle logs in a custom manner



19
20
21
# File 'lib/vwo/custom_logger.rb', line 19

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