updated logging to make the prog_name an argument