Sha256: 2cf039e61b56ba9f86723cf115ab21700290d719027e5a52a784442cff46fede

Contents?: true

Size: 291 Bytes

Versions: 7

Compression:

Stored size: 291 Bytes

Contents

class ResponseLogger

  def object_log(code=nil, body)
    log = File.open "#{LOG}", 'a+'
    log.write "call @ #{timestamp}"
    log.write "HTTP #{code}\n" unless code==nil
    log.write JSON.pretty_generate body
    log.write "\n"
    log.close
  end

  def timestamp
    `date`
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
apidragon-1.4.5 lib/apidragon/log.rb
apidragon-1.4.4 lib/apidragon/log.rb
apidragon-1.4.3 lib/apidragon/log.rb
apidragon-1.4.1 lib/apidragon/log.rb
apidragon-1.4.0 lib/apidragon/log.rb
apidragon-1.3.0 lib/apidragon/log.rb
apidragon-1.2.1 lib/apidragon/log.rb