Class: VWO::Logger
- Inherits:
-
Object
- Object
- VWO::Logger
- 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
-
#initialize(logger_instance) ⇒ Logger
constructor
A new instance of Logger.
- #instance ⇒ Object
- #level ⇒ Object
-
#log(level, message) ⇒ Object
Override this method to handle logs in a custom manner.
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
#instance ⇒ Object
40 41 42 |
# File 'lib/vwo/logger.rb', line 40 def instance @@logger_instance end |
#level ⇒ Object
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, ) @@logger_instance.log(level, ) end |