Module: Cure::Log

Instance Method Summary collapse

Instance Method Details

#log_debug(message) ⇒ Object

Parameters:



15
16
17
# File 'lib/cure/log.rb', line 15

def log_debug(message)
  Cure.logger.debug(message)
end

#log_error(message, exception = nil) ⇒ Object

Parameters:

  • message (String)
  • exception (Exception/Nil) (defaults to: nil)


31
32
33
34
# File 'lib/cure/log.rb', line 31

def log_error(message, exception=nil)
  Cure.logger.error(message)
  Cure.logger.error(exception.backtrace.join("\n")) unless exception.nil?
end

#log_info(message) ⇒ Object

Parameters:



20
21
22
# File 'lib/cure/log.rb', line 20

def log_info(message)
  Cure.logger.info(message)
end

#log_trace(_message) ⇒ Object

Parameters:



8
9
10
11
12
# File 'lib/cure/log.rb', line 8

def log_trace(_message)
  # Ruby default logger doesnt have trace, so my version
  # is to just uncomment it when you need it for now.
  # Cure.logger.trace(message)
end

#log_warn(message) ⇒ Object

Parameters:



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

def log_warn(message)
  Cure.logger.warn(message)
end