Module: MuffinMan::EnableLogger

Included in:
Finances::V0
Defined in:
lib/muffin_man/enable_logger.rb

Constant Summary collapse

LOGGING_ENABLED =
true

Instance Method Summary collapse

Instance Method Details

#log_request_and_response(level, res) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/muffin_man/enable_logger.rb', line 7

def log_request_and_response(level, res)
  log_info = "REQUEST\n
    canonical_uri:#{canonical_uri}\n\n
    query_params:#{query_params}\n\n
    RESPONSE\n
    response_headers=#{res.headers}\n\n
    response_body=#{res.body}\n\n
  "
  MuffinMan.logger.send(level, log_info)
end