Add to the log format "*/*" if using a not found format:

The rendering template is processing as */* but in the log is
  "Processing by Controller#action as "

This change add the */* for the log and showing as
  "Processing by Controller#action as */*"
when there not founds for the extension of format.
上级 785427b8
......@@ -11,6 +11,7 @@ def start_processing(event)
params = payload[:params].except(*INTERNAL_PARAMS)
format = payload[:format]
format = format.to_s.upcase if format.is_a?(Symbol)
format = "*/*" if format.nil?
info "Processing by #{payload[:controller]}##{payload[:action]} as #{format}"
info " Parameters: #{params.inspect}" unless params.empty?
......
......@@ -121,6 +121,20 @@ def test_start_processing
assert_equal "Processing by Another::LogSubscribersController#show as HTML", logs.first
end
def test_start_processing_as_json
get :show, format: "json"
wait
assert_equal 2, logs.size
assert_equal "Processing by Another::LogSubscribersController#show as JSON", logs.first
end
def test_start_processing_as_non_exten
get :show, format: "noext"
wait
assert_equal 2, logs.size
assert_equal "Processing by Another::LogSubscribersController#show as */*", logs.first
end
def test_halted_callback
get :never_executed
wait
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册