better logging for run_cmd