Class: Gridium::Log

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

Class Method Summary collapse

Class Method Details

.add_device(device) ⇒ Object



85
86
87
88
89
90
# File 'lib/log.rb', line 85

def add_device device
  @@devices ||= []
  log.attach(device)
  @@devices << device
  log.add(log.level, "device added: #{File.absolute_path(device)}")
end

.closeObject



92
93
94
95
96
# File 'lib/log.rb', line 92

def close
  @@devices.each { |dev| @@logger.detach(dev) }
  @@devices.clear
  log.close if log
end

.debug(msg) ⇒ Object

more generic than INFO, useful for debugging issues DEBUG = 0 generic, useful information about system operation INFO = 1 a warning WARN = 2 a handleable error condition ERROR = 3 an unhandleable error that results in a program crash FATAL = 4 an unknown message that should always be logged UNKNOWN = 5



65
66
67
# File 'lib/log.rb', line 65

def debug(msg)
  log.debug(msg)
end

.error(msg) ⇒ Object



79
80
81
82
83
# File 'lib/log.rb', line 79

def error(msg)
  log.error(msg)
  Driver.save_screenshot('error') if Gridium.config.screenshot_on_failure
  SpecData.verification_errors << msg
end

.info(msg) ⇒ Object



69
70
71
# File 'lib/log.rb', line 69

def info(msg)
  log.info(msg)
end

.warn(msg) ⇒ Object



73
74
75
76
77
# File 'lib/log.rb', line 73

def warn(msg)
  log.warn(msg)
  Driver.save_screenshot('warning') if Gridium.config.screenshot_on_failure
  SpecData.execution_warnings << msg
end