Hello, I am currently logging requests like so:
puts response.request.instance_variable_get(:@raw_request).body
Is there a better way to do this?
I've found this example in the code:
# Turns on logging
#
# class Foo
# include HTTParty
# logger Logger.new('http_logger'), :info, :apache
# end
def logger(logger, level=:info, format=:apache)
default_options[:logger] = logger
default_options[:log_level] = level
default_options[:log_format] = format
end
When I add
logger Logger.new('http_logger'), :info, :apache
to my code I get this error:
NoMethodError: undefined method `new' for HTTParty::Logger:Module
Thanks!
Eric
Also, is there a way to format text as code?