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