[Misc] Use parameters to build the log string to improve readability and performance