module ActionController::Logging::ClassMethods

def log_at(level, **options)


end
log_at :debug, if: -> { cookies[:debug] }
class ApplicationController < ActionController::Base
# Use the debug log level if a particular cookie is set.

Set a different log level per request.
def log_at(level, **options)
  around_action ->(_, action) { logger.log_at(level, &action) }, **options
end