It's probably better to put the log statement before taking the action rather than after, otherwise you don't get any useful information if something goes wrong (e.g. a posix system where xdg-open doesn't exist).