The log produced when installing something is /var/log/pacman.log
.
This is in turn created by libalpm - the backend for pacman - which is provided by upstream Arch Linux.
As such the possibility of adding comments to the log file does not seem available.
I am curious though - and while I am not bored - it is peeking my interest into looking into it.
Another member is working on a project called logKonsult - which has some editing functions build-in - I have mentioned this topic at [GUI APP] logkonsult - view pacman logs (Qt6) - #5 by linux-aarhus