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-7.0.7 lib/action_controller/metal/logging.rb
actionpack-7.0.6 lib/action_controller/metal/logging.rb
actionpack-7.0.5.1 lib/action_controller/metal/logging.rb
actionpack-6.1.7.4 lib/action_controller/metal/logging.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/logging.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/logging.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionpack-7.0.2.3/lib/action_controller/metal/logging.rb
actionpack-7.0.5 lib/action_controller/metal/logging.rb
actionpack-7.0.4.3 lib/action_controller/metal/logging.rb
actionpack-6.1.7.3 lib/action_controller/metal/logging.rb
actionpack-6.1.7.2 lib/action_controller/metal/logging.rb
actionpack-7.0.4.2 lib/action_controller/metal/logging.rb
actionpack-7.0.4.1 lib/action_controller/metal/logging.rb
actionpack-6.1.7.1 lib/action_controller/metal/logging.rb
actionpack-7.0.4 lib/action_controller/metal/logging.rb
actionpack-6.1.7 lib/action_controller/metal/logging.rb
actionpack-7.0.3.1 lib/action_controller/metal/logging.rb
actionpack-6.1.6.1 lib/action_controller/metal/logging.rb
actionpack-6.1.6 lib/action_controller/metal/logging.rb
actionpack-7.0.3 lib/action_controller/metal/logging.rb