Merge "logd: consolidate command handling and fix an error check"