Sha256: e1f4e982dfe2cafe93f579155ad2623813b56f30c2476cb95d45d924a71854de

Contents?: true

Size: 318 Bytes

Versions: 13

Compression:

Stored size: 318 Bytes

Contents

class ResponseLogger

  def object_log(code=nil, body)
    body = JSON.parse 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

13 entries across 13 versions & 1 rubygems

Version Path
apidragon-1.8.0 lib/apidragon/log.rb
apidragon-1.7.1 lib/apidragon/log.rb
apidragon-1.7.0 lib/apidragon/log.rb
apidragon-1.6.3 lib/apidragon/log.rb
apidragon-1.6.2 lib/apidragon/log.rb
apidragon-1.6.1 lib/apidragon/log.rb
apidragon-1.6.0 lib/apidragon/log.rb
apidragon-1.5.4 lib/apidragon/log.rb
apidragon-1.5.3 lib/apidragon/log.rb
apidragon-1.5.2 lib/apidragon/log.rb
apidragon-1.5.1 lib/apidragon/log.rb
apidragon-1.5.0 lib/apidragon/log.rb
apidragon-1.4.6 lib/apidragon/log.rb