Class: LicenseFinder::Logger

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

Constant Summary collapse

MODE_QUIET =
:quiet
MODE_INFO =
:info
MODE_DEBUG =
:debug

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mode = nil) ⇒ Logger

Returns a new instance of Logger.



13
14
15
16
17
18
19
20
# File 'lib/license_finder/logger.rb', line 13

def initialize(mode = nil)
  @system_logger = ::Logger.new(STDOUT)
  @system_logger.formatter = proc do |_, _, _, msg|
    "#{msg}\n"
  end

  self.mode = mode || MODE_INFO
end

Instance Attribute Details

#modeObject

Returns the value of attribute mode.



11
12
13
# File 'lib/license_finder/logger.rb', line 11

def mode
  @mode
end