Sha256: 18564bf8396bd365d863dc964ce7f6e36e86033982c8ad6334dfb53de42bd1eb

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

require 'logger'

module Rlyeh
  module DeepOnes
    class Logger
      def initialize(app, options = {})
        @app = app
        @logger = options[:logger] || ::Logger.new(STDOUT)
        @logger.level = options[:level] || ::Logger::INFO
      end

      def call(env)
        write env
        @app.call env
      end

      def write(env)
        @logger.debug env.data
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rlyeh-0.0.2 lib/rlyeh/deep_ones/logger.rb