Class: Scarpe::Components::PrintLogImpl::PrintLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/scarpe/components/print_logger.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component_name) ⇒ PrintLogger

Returns a new instance of PrintLogger.



16
17
18
# File 'lib/scarpe/components/print_logger.rb', line 16

def initialize(component_name)
  @comp_name = component_name
end

Class Attribute Details

.silenceObject

Returns the value of attribute silence.



13
14
15
# File 'lib/scarpe/components/print_logger.rb', line 13

def silence
  @silence
end

Instance Method Details

#debug(msg) ⇒ Object



28
29
30
# File 'lib/scarpe/components/print_logger.rb', line 28

def debug(msg)
  puts "#{@comp_name} debug: #{msg}" unless PrintLogger.silence
end

#error(msg) ⇒ Object



20
21
22
# File 'lib/scarpe/components/print_logger.rb', line 20

def error(msg)
  puts "#{@comp_name} error: #{msg}" unless PrintLogger.silence
end

#info(msg) ⇒ Object



32
33
34
# File 'lib/scarpe/components/print_logger.rb', line 32

def info(msg)
  puts "#{@comp_name} info: #{msg}" unless PrintLogger.silence
end

#warn(msg) ⇒ Object



24
25
26
# File 'lib/scarpe/components/print_logger.rb', line 24

def warn(msg)
  puts "#{@comp_name} warn: #{msg}" unless PrintLogger.silence
end