Sha256: 637533010caf963cf5967893fc7b4af467ad10937a2831b88fc3aa4374d529e8

Contents?: true

Size: 536 Bytes

Versions: 94

Compression:

Stored size: 536 Bytes

Contents

# frozen_string_literal: true

module ActionController
  module Logging
    extend ActiveSupport::Concern

    module ClassMethods
      # Set a different log level per request.
      #
      #   # Use the debug log level if a particular cookie is set.
      #   class ApplicationController < ActionController::Base
      #     log_at :debug, if: -> { cookies[:debug] }
      #   end
      #
      def log_at(level, **options)
        around_action ->(_, action) { logger.log_at(level, &action) }, **options
      end
    end
  end
end

Version data entries

94 entries across 89 versions & 9 rubygems

Version Path
actionpack-6.1.7.8 lib/action_controller/metal/logging.rb
actionpack-7.1.3.2 lib/action_controller/metal/logging.rb
actionpack-7.1.3.1 lib/action_controller/metal/logging.rb
actionpack-7.0.8.1 lib/action_controller/metal/logging.rb
actionpack-6.1.7.7 lib/action_controller/metal/logging.rb
actionpack-7.1.3 lib/action_controller/metal/logging.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionpack-7.0.2.3/lib/action_controller/metal/logging.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/logging.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/logging.rb
actionpack-7.1.2 lib/action_controller/metal/logging.rb
actionpack-7.1.1 lib/action_controller/metal/logging.rb
actionpack-7.1.0 lib/action_controller/metal/logging.rb
actionpack-7.1.0.rc2 lib/action_controller/metal/logging.rb
actionpack-7.1.0.rc1 lib/action_controller/metal/logging.rb
actionpack-7.1.0.beta1 lib/action_controller/metal/logging.rb
actionpack-7.0.8 lib/action_controller/metal/logging.rb
actionpack-7.0.7.2 lib/action_controller/metal/logging.rb
actionpack-6.1.7.6 lib/action_controller/metal/logging.rb
actionpack-7.0.7.1 lib/action_controller/metal/logging.rb
actionpack-6.1.7.5 lib/action_controller/metal/logging.rb