Class: GRCommons::GRLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/gr_commons/gr_logger.rb

Overview

Note:

Mainly used by developers for debugging.

If GR.rb call native functions of the GR framework, it will be recorded in the log file.

How it works 

It prepend a module named Inspector to the singular class of the FFI module. It will inspects the GR function call of the FFI module

Examples:

require 'gr_commons/gr_logger'
GRCommons::GRLogger.new("log.txt")

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(out = $stderr) ⇒ GRLogger

Returns a new instance of GRLogger.



52
53
54
55
# File 'lib/gr_commons/gr_logger.rb', line 52

def initialize(out = $stderr)
  super(out, level: :info)
  @@logger ||= self
end

Class Method Details

.loggerObject

Return the last created GRLogger



48
49
50
# File 'lib/gr_commons/gr_logger.rb', line 48

def self.logger
  @@logger ||= GRCommons::GRLogger.new
end