Sha256: 57a712ce16a08f08858cd3a0b627c8a9a006f7b25157733c29cdfc248550336d
Contents?: true
Size: 867 Bytes
Versions: 18
Compression:
Stored size: 867 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 info(message) return unless Soaspec.log_api_traffic? if message.respond_to? :each message.each do |message_item| @logger.info(message_item) end else @logger.info(message) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems