Class: Vedeu::Instrumentation::Log

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

Overview

:nocov:

Class Method Summary collapse

Class Method Details

.error(exception) ⇒ Object



19
20
21
22
23
24
# File 'lib/vedeu/instrumentation.rb', line 19

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

  logger.debug(message)
end

.loggerObject



11
12
13
14
15
16
17
# File 'lib/vedeu/instrumentation.rb', line 11

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