Class: Fuzz::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/fuzz/log.rb

Overview

Default Reporting/Logging

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output = Fuzz::Console) ⇒ Reporter



17
18
19
20
21
# File 'lib/fuzz/log.rb', line 17

def initialize(output = Fuzz::Console)
  @output = output
  klass = class << self; self; end
  klass.__send__(:include, @output.colorizer_include)
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



23
24
25
# File 'lib/fuzz/log.rb', line 23

def output
  @output
end

Instance Method Details

#log_error(msg) ⇒ Object



25
26
27
# File 'lib/fuzz/log.rb', line 25

def log_error(msg)
  output.error_println 'Fuzz - ', red(bold 'ERROR'), ' : ', msg
end

#log_info(msg) ⇒ Object



33
34
35
# File 'lib/fuzz/log.rb', line 33

def log_info(msg)
  output.println 'Fuzz - ', msg
end

#log_warning(msg) ⇒ Object



29
30
31
# File 'lib/fuzz/log.rb', line 29

def log_warning(msg)
  output.error_println 'Fuzz - ', yellow(bold 'WARNING'), ' : ', msg
end

#show_error(msg) ⇒ Object



37
38
39
# File 'lib/fuzz/log.rb', line 37

def show_error(msg)
  log_error(msg)
end

#show_msg(msg) ⇒ Object



45
46
47
# File 'lib/fuzz/log.rb', line 45

def show_msg(msg)
  log(msg)
end

#show_warning(msg) ⇒ Object



41
42
43
# File 'lib/fuzz/log.rb', line 41

def show_warning(msg)
  log_error(msg)
end