Sha256: c33336b2d674b3756664d28add13a9cce00192f9a9450f261b0550fa0335db4f

Contents?: true

Size: 664 Bytes

Versions: 27

Compression:

Stored size: 664 Bytes

Contents

require 'logger'
require 'fileutils'

module Soaspec

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

      # Log a message using Soaspec logger
      # @param [String] message The message to add to the logger
      def add_to(message)
        @logger.info(message)
      end
    end

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
soaspec-0.0.84 lib/soaspec/spec_logger.rb
soaspec-0.0.81 lib/soaspec/spec_logger.rb
soaspec-0.0.80 lib/soaspec/spec_logger.rb
soaspec-0.0.79 lib/soaspec/spec_logger.rb
soaspec-0.0.78 lib/soaspec/spec_logger.rb
soaspec-0.0.77 lib/soaspec/spec_logger.rb
soaspec-0.0.76 lib/soaspec/spec_logger.rb
soaspec-0.0.75 lib/soaspec/spec_logger.rb
soaspec-0.0.74 lib/soaspec/spec_logger.rb
soaspec-0.0.73 lib/soaspec/spec_logger.rb
soaspec-0.0.72 lib/soaspec/spec_logger.rb
soaspec-0.0.71 lib/soaspec/spec_logger.rb
soaspec-0.0.70 lib/soaspec/spec_logger.rb
soaspec-0.0.69 lib/soaspec/spec_logger.rb
soaspec-0.0.68 lib/soaspec/spec_logger.rb
soaspec-0.0.67 lib/soaspec/spec_logger.rb
soaspec-0.0.66 lib/soaspec/spec_logger.rb
soaspec-0.0.65 lib/soaspec/spec_logger.rb
soaspec-0.0.64 lib/soaspec/spec_logger.rb
soaspec-0.0.63 lib/soaspec/spec_logger.rb