Sha256: a9a8280b4823924caeb6613b99fcbe4a43e412b62c9ce06f19d4b82a7c72a385

Contents?: true

Size: 596 Bytes

Versions: 5

Compression:

Stored size: 596 Bytes

Contents

# encoding: UTF-8

require 'logger'

require_relative 'base_middleware'

module GoodData
  module Bricks
    class LoggerMiddleware < Bricks::Middleware
      def call(params)
        logger = nil
        if params['GDC_LOGGING_OFF']
          logger = NilLogger.new
        else
          logger = params['GDC_LOGGER'] = params[:GDC_LOGGER_FILE].nil? ? Logger.new(STDOUT) : Logger.new(params[:GDC_LOGGER_FILE])
          logger.info('Pipeline starts')
        end
        returning(@app.call(params)) do |_result|
          logger.info('Pipeline ending')
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gooddata-0.6.20 lib/gooddata/bricks/middleware/logger_middleware.rb
gooddata-0.6.19 lib/gooddata/bricks/middleware/logger_middleware.rb
gooddata-0.6.18 lib/gooddata/bricks/middleware/logger_middleware.rb
gooddata-0.6.17 lib/gooddata/bricks/middleware/logger_middleware.rb
gooddata-0.6.16 lib/gooddata/bricks/middleware/logger_middleware.rb