- // build the status str
- std::ostringstream status;
- status << "Status: " << "progress" << std::endl
- << "Package: " << PackageName << std::endl
- << "Percent: " << (StepsDone/float(StepsTotal)*100.0) << std::endl
- << "Message: " << message << std::endl
- << std::endl;
- WriteToStatusFd(status.str());
-
+ std::string status;
+ strprintf(status, "Status: %s\nPackage: %s\nPercent: %.4f\nMessage: %s\n\n", "progress",
+ PackageName.c_str(), (StepsDone/float(StepsTotal)*100.0), message.c_str());
+ WriteToStatusFd(std::move(status));