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