Class: Vedeu::API::Log

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

Class Method Summary collapse

Class Method Details

.error(exception) ⇒ Object



15
16
17
18
19
20
# File 'lib/vedeu/api/log.rb', line 15

def self.error(exception)
  backtrace = exception.backtrace.join("\n")
  message   = exception.message + "\n" + backtrace

  logger.debug(message)
end

.loggerObject



7
8
9
10
11
12
13
# File 'lib/vedeu/api/log.rb', line 7

def self.logger
  @logger ||= Logger.new(filename).tap do |log|
    log.formatter = proc do |_, time, _, message|
      time.utc.iso8601 + ": " + message + "\n"
    end
  end
end