Sha256: 12f5fc6634778b25312517c4c03e0fd13bb14105a7142f154ca152f824c936e3

Contents?: true

Size: 353 Bytes

Versions: 3

Compression:

Stored size: 353 Bytes

Contents

require 'json'

class ResponseLogger

  def initialize(log_path)
    @path = log_path
  end

  def log(call, code, response)
    log = File.open "#{@path}/veracodecli.log", 'a+'
    log.write "#{call} called @ #{timestamp}"
    log.write "HTTP #{code}"
    log.write response
    log.write "\n"
    log.close
  end

  def timestamp
    `date`
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veracodecli-1.0.10 lib/veracodecli/log.rb
veracodecli-1.0.9 lib/veracodecli/log.rb
veracodecli-1.0.8 lib/veracodecli/log.rb