[PATCH v5 6/9] treewide: Replace perror() calls with calls to logging functions