logToFile(): const reference is used instead of argument forwarding.