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