Move logging to a spot after all $command modifications.