Module: ReVIEW::Loggable

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



3
4
5
# File 'lib/review/loggable.rb', line 3

def logger
  @logger
end

Instance Method Details

#app_error(msg) ⇒ Object

Raises:



9
10
11
# File 'lib/review/loggable.rb', line 9

def app_error(msg)
  raise ApplicationError, msg
end

#debug(msg, location: nil) ⇒ Object



23
24
25
# File 'lib/review/loggable.rb', line 23

def debug(msg, location: nil)
  logger.debug(msg, location: location)
end

#error(msg, location: nil) ⇒ Object



5
6
7
# File 'lib/review/loggable.rb', line 5

def error(msg, location: nil)
  logger.error(msg, location: location)
end

#error!(msg, location: nil) ⇒ Object



13
14
15
16
17
# File 'lib/review/loggable.rb', line 13

def error!(msg, location: nil)
  logger.error(msg, location: location)

  exit 1
end

#warn(msg, location: nil) ⇒ Object



19
20
21
# File 'lib/review/loggable.rb', line 19

def warn(msg, location: nil)
  logger.warn(msg, location: location)
end