Sha256: affd8395e4df5531e0451341bb2d47262a7632fa3ee27bffce9b62e78b58c4c1

Contents?: true

Size: 497 Bytes

Versions: 29

Compression:

Stored size: 497 Bytes

Contents

require 'logger'
require 'fileutils'

module Soaspec

  # Handles logs of API requests and responses
  class SpecLogger
    def self.create
      unless File.exist?('logs/traffic.log')
        FileUtils.mkdir_p 'logs'
        FileUtils.touch 'traffic.log'
      end
      @logger = Logger.new('logs/traffic.log') # Where request and responses of APIs are stored
      @logger.level = Logger::DEBUG
      @logger
    end

    def self.add_to(message)
      @logger.info(message)
    end

  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
soaspec-0.0.55 lib/soaspec/spec_logger.rb
soaspec-0.0.54 lib/soaspec/spec_logger.rb
soaspec-0.0.53 lib/soaspec/spec_logger.rb
soaspec-0.0.52 lib/soaspec/spec_logger.rb
soaspec-0.0.51 lib/soaspec/spec_logger.rb
soaspec-0.0.50 lib/soaspec/spec_logger.rb
soaspec-0.0.49 lib/soaspec/spec_logger.rb
soaspec-0.0.48 lib/soaspec/spec_logger.rb
soaspec-0.0.47 lib/soaspec/spec_logger.rb
soaspec-0.0.46 lib/soaspec/spec_logger.rb
soaspec-0.0.45 lib/soaspec/spec_logger.rb
soaspec-0.0.44 lib/soaspec/spec_logger.rb
soaspec-0.0.43 lib/soaspec/spec_logger.rb
soaspec-0.0.42 lib/soaspec/spec_logger.rb
soaspec-0.0.41 lib/soaspec/spec_logger.rb
soaspec-0.0.40 lib/soaspec/spec_logger.rb
soaspec-0.0.39 lib/soaspec/spec_logger.rb
soaspec-0.0.38 lib/soaspec/spec_logger.rb
soaspec-0.0.37 lib/soaspec/spec_logger.rb
soaspec-0.0.36 lib/soaspec/spec_logger.rb