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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <stdarg.h>
6 #include <stdio.h>
7
8 #include "debug.h"
9
10 namespace relocation_packer {
11
12 Logger* Logger::instance_ = NULL;
13
14 Logger* Logger::GetInstance() {
15 if (instance_ == NULL)
16 instance_ = new Logger;
17 return instance_;
18 }
19
20 void Logger::Log(const char* format, va_list args) {
21 vfprintf(stdout, format, args);
22 }
23
24 void Logger::Log(const char* format, ...) {
25 va_list args;
26 va_start(args, format);
27 GetInstance()->Log(format, args);
28 va_end(args);
29 }
30
31 void Logger::VLog(const char* format, ...) {
32 if (GetInstance()->is_verbose_) {
33 va_list args;
34 va_start(args, format);
35 GetInstance()->Log(format, args);
36 va_end(args);
37 }
38 }
39
40 void Logger::SetVerbose(bool flag) {
41 GetInstance()->is_verbose_ = flag;
42 }
43
44 } // namespace relocation_packer
OLDNEW
« 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