Module: Evva::Logger

Extended by:
Logger
Included in:
Logger
Defined in:
lib/evva/logger.rb

Instance Method Summary collapse

Instance Method Details

#clean_summaryObject



20
21
22
# File 'lib/evva/logger.rb', line 20

def clean_summary
  @levels.each { |k, _| @levels[k] = 0 }
end

#error(msg) ⇒ Object



16
17
18
# File 'lib/evva/logger.rb', line 16

def error(msg)
  log :error, msg
end

#info(msg) ⇒ Object



8
9
10
# File 'lib/evva/logger.rb', line 8

def info(msg)
  log :info, msg
end


28
29
30
31
32
33
34
35
36
# File 'lib/evva/logger.rb', line 28

def print_summary
  if @levels[:warn] > 0 || @levels[:error] > 0
    info ""
    info "Finished with:"
    info "  #{@levels[:warn]} warnings" if @levels[:warn]  > 0
    info "  #{@levels[:error]} errors"  if @levels[:error] > 0
    info ""
  end
end

#silent_mode=(value) ⇒ Object



38
39
40
# File 'lib/evva/logger.rb', line 38

def silent_mode=(value)
  @silent_mode = value
end

#summaryObject



24
25
26
# File 'lib/evva/logger.rb', line 24

def summary
  @levels
end

#warn(msg) ⇒ Object



12
13
14
# File 'lib/evva/logger.rb', line 12

def warn(msg)
  log :warn, msg
end