Improve logging

I think that you should strip the path to the command, i.e. os.path.basename(cmd[0]) instead of cmd[0].