Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: tools/relocation_packer/src/main.cc

Issue 392653002: Upgrade logging to resemble base/logging.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update for review feedback Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/relocation_packer/src/elf_file.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/relocation_packer/src/main.cc
diff --git a/tools/relocation_packer/src/main.cc b/tools/relocation_packer/src/main.cc
index 4bc09b6e5eebbd67ef68c8e23ba4936dcb72f592..d5ff83c9b087d59d00846b454e1e09955f88a1e0 100644
--- a/tools/relocation_packer/src/main.cc
+++ b/tools/relocation_packer/src/main.cc
@@ -29,7 +29,8 @@
#include "debug.h"
#include "elf_file.h"
#include "libelf.h"
-#include "packer.h"
+
+namespace {
void PrintUsage(const char* argv0) {
std::string temporary = argv0;
@@ -66,6 +67,8 @@ void PrintUsage(const char* argv0) {
basename, basename, basename);
}
+} // namespace
+
int main(int argc, char* argv[]) {
bool is_unpacking = false;
bool is_verbose = false;
@@ -92,7 +95,7 @@ int main(int argc, char* argv[]) {
PrintUsage(argv[0]);
return 0;
case '?':
- LOG("Try '%s --help' for more information.\n", argv[0]);
+ LOG(INFO) << "Try '" << argv[0] << " --help' for more information.";
return 1;
case -1:
has_options = false;
@@ -102,22 +105,23 @@ int main(int argc, char* argv[]) {
}
}
if (optind != argc - 1) {
- LOG("Try '%s --help' for more information.\n", argv[0]);
+ LOG(INFO) << "Try '" << argv[0] << " --help' for more information.";
return 1;
}
if (elf_version(EV_CURRENT) == EV_NONE) {
- LOG("WARNING: Elf Library is out of date!\n");
+ LOG(WARNING) << "Elf Library is out of date!";
}
const char* file = argv[argc - 1];
const int fd = open(file, O_RDWR);
if (fd == -1) {
- LOG("%s: %s\n", file, strerror(errno));
+ LOG(ERROR) << file << ": " << strerror(errno);
return 1;
}
- relocation_packer::Logger::SetVerbose(is_verbose);
+ if (is_verbose)
+ relocation_packer::Logger::SetVerbose(1);
relocation_packer::ElfFile elf_file(fd);
elf_file.SetPadding(is_padding);
@@ -131,7 +135,7 @@ int main(int argc, char* argv[]) {
close(fd);
if (!status) {
- LOG("ERROR: %s: failed to pack/unpack file\n", file);
+ LOG(ERROR) << file << ": failed to pack/unpack file";
return 1;
}
« no previous file with comments | « tools/relocation_packer/src/elf_file.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698