跳到內容 跳到搜尋
方法
L

實例公共方法

log_at(level, **options)

設定每個 request 不同的日誌層級。

# Use the debug log level if a particular cookie is set.
class ApplicationController < ActionController::Base
  log_at :debug, if: -> { cookies[:debug] }
end
# File actionpack/lib/action_controller/metal/logging.rb, line 17
def log_at(level, **options)
  around_action ->(_, action) { logger.log_at(level, &action) }, **options
end