Use PLOG instead of LOG with strerror()
This patch replaces "LOG() << ... << strerror(errno)" by "PLOG() << ..."
when possible, which provides equivalent functionality.
BUG=None
TEST=cbuildbot amd64-generic-full
Change-Id: I760689818a3647efa980c96305a0bc8cf0bb4ac0
Reviewed-on: https://chromium-review.googlesource.com/264834
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/http_fetcher_unittest.cc b/http_fetcher_unittest.cc
index a50654e..119c3d9 100644
--- a/http_fetcher_unittest.cc
+++ b/http_fetcher_unittest.cc
@@ -113,8 +113,7 @@
int line_len = read(server_stdout, line, sizeof(line) - 1);
if (line_len <= static_cast<int>(listening_msg_prefix_len)) {
if (line_len < 0) {
- LOG(ERROR) << "error reading http server stdout: "
- << strerror(errno);
+ PLOG(ERROR) << "error reading http server stdout";
} else {
LOG(ERROR) << "server output too short";
}
diff --git a/utils.h b/utils.h
index 6d8b373..f242c39 100644
--- a/utils.h
+++ b/utils.h
@@ -522,8 +522,7 @@
should_remove_(true) {}
~ScopedPathUnlinker() {
if (should_remove_ && unlink(path_.c_str()) < 0) {
- std::string err_message = strerror(errno);
- LOG(ERROR) << "Unable to unlink path " << path_ << ": " << err_message;
+ PLOG(ERROR) << "Unable to unlink path " << path_;
}
}
void set_should_remove(bool should_remove) { should_remove_ = should_remove; }