Improve outer logging a bit.
Honor debug file hook from the action script.