Module: Yake

Defined in:
lib/yake/api.rb,
lib/yake/dsl.rb,
lib/yake/errors.rb,
lib/yake/logger.rb,
lib/yake/version.rb

Defined Under Namespace

Modules: API, DSL, Errors, Logger

Constant Summary collapse

VERSION =
"0.2.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



30
31
32
# File 'lib/yake/logger.rb', line 30

def logger
  @logger
end

Class Method Details

.wrap(event = nil, context = nil, &block) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/yake/logger.rb', line 36

def wrap(event = nil, context = nil, &block)
  original_progname = logger.progname
  logger.progname = context&.aws_request_id
  logger.info("EVENT #{ event.to_json }")
  yield(event, context).tap { |res| logger.info("RETURN #{ res.to_json }") }
ensure
  logger.progname = original_progname
end