You're going about this the wrong way. You want to log all commands you enter? Fish already by default keeps the last 256k deduplicated entries from all sessions, so you don't actually need to do anything.
If you wanted a PROMPT_COMMAND equivalent, well, to display a prompt there's the fish_prompt
function (which you have already customized), and to do something else every time a prompt appears there's the fish_prompt
event, which you can define a listener for like
function name --on-event fish_prompt
# do stuff
end
If you wish to log everything you execute to some other file, there's the fish_preexec
event, so
function log_commands --on-event fish_preexec
# fish_preexec functions receive the commandline as the argument (see `function --help`)
echo $argv >> ~/fish.log
end
would work.