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

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

Issue 310483003: Add a host tool to pack R_ARM_RELATIVE relocations in libchrome.<ver>.so. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove binary test data files, dcommit separately. Created 6 years, 6 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/debug.h ('k') | tools/relocation_packer/src/elf_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/relocation_packer/src/debug.cc
diff --git a/tools/relocation_packer/src/debug.cc b/tools/relocation_packer/src/debug.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b78e25062d689ad5b3a9520fd978a8c0e8c672ea
--- /dev/null
+++ b/tools/relocation_packer/src/debug.cc
@@ -0,0 +1,44 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "debug.h"
+
+namespace relocation_packer {
+
+Logger* Logger::instance_ = NULL;
+
+Logger* Logger::GetInstance() {
+ if (instance_ == NULL)
+ instance_ = new Logger;
+ return instance_;
+}
+
+void Logger::Log(const char* format, va_list args) {
+ vfprintf(stdout, format, args);
+}
+
+void Logger::Log(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ GetInstance()->Log(format, args);
+ va_end(args);
+}
+
+void Logger::VLog(const char* format, ...) {
+ if (GetInstance()->is_verbose_) {
+ va_list args;
+ va_start(args, format);
+ GetInstance()->Log(format, args);
+ va_end(args);
+ }
+}
+
+void Logger::SetVerbose(bool flag) {
+ GetInstance()->is_verbose_ = flag;
+}
+
+} // namespace relocation_packer
« no previous file with comments | « tools/relocation_packer/src/debug.h ('k') | tools/relocation_packer/src/elf_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698