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

Side by Side Diff: tools/relocation_packer/src/debug.h

Issue 404553003: Create builds configured for ARM and AARCH64. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename DT tags to DT_ANDROID_REL_XXX 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Logging and checks. Avoids a dependency on base. 5 // Logging and checks. Avoids a dependency on base.
6 // 6 //
7 // LOG(tag) prints messages. Tags are INFO, WARNING, ERROR and FATAL. 7 // LOG(tag) prints messages. Tags are INFO, WARNING, ERROR and FATAL.
8 // INFO prints to stdout, the others to stderr. FATAL aborts after printing. 8 // INFO prints to stdout, the others to stderr. FATAL aborts after printing.
9 // 9 //
10 // LOG_IF(tag, predicate) logs if predicate evaluates to true, else silent. 10 // LOG_IF(tag, predicate) logs if predicate evaluates to true, else silent.
11 // 11 //
12 // VLOG(level) logs INFO messages where level is less than or equal to the 12 // VLOG(level) logs INFO messages where level is less than or equal to the
13 // verbosity level set with SetVerbose(). 13 // verbosity level set with SetVerbose().
14 // 14 //
15 // VLOG_IF(level, predicate) logs INFO if predicate evaluates to true, 15 // VLOG_IF(level, predicate) logs INFO if predicate evaluates to true,
16 // else silent. 16 // else silent.
17 // 17 //
18 // CHECK(predicate) logs a FATAL error if predicate is false. 18 // CHECK(predicate) logs a FATAL error if predicate is false.
19 // NOTREACHED() always aborts. 19 // NOTREACHED() always aborts.
20 // Log streams can be changed with SetStreams(). Logging is not thread-safe. 20 // Log streams can be changed with SetStreams(). Logging is not thread-safe.
21 // 21 //
22 22
23 #ifndef TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_ 23 #ifndef TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_
24 #define TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_ 24 #define TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_
25 25
26 #include <limits.h> 26 #include <limits.h>
27 #include <algorithm>
28 #include <ostream> 27 #include <ostream>
29 #include <sstream> 28 #include <sstream>
30 29
31 namespace relocation_packer { 30 namespace relocation_packer {
32 31
33 class Logger { 32 class Logger {
34 public: 33 public:
35 enum Severity {INFO = 0, WARNING, ERROR, FATAL}; 34 enum Severity {INFO = 0, WARNING, ERROR, FATAL};
36 35
37 // Construct a new message logger. Prints if level is less than or 36 // Construct a new message logger. Prints if level is less than or
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 #define CHECK(predicate) (LOG_IF(FATAL, !(predicate)) \ 106 #define CHECK(predicate) (LOG_IF(FATAL, !(predicate)) \
108 << __FILE__ << ":" << __LINE__ << ": " \ 107 << __FILE__ << ":" << __LINE__ << ": " \
109 << __FUNCTION__ << ": CHECK '" #predicate "' failed") 108 << __FUNCTION__ << ": CHECK '" #predicate "' failed")
110 109
111 // NOTREACHED() always fails with a FATAL log message. 110 // NOTREACHED() always fails with a FATAL log message.
112 #define NOTREACHED(_) (LOG(FATAL) \ 111 #define NOTREACHED(_) (LOG(FATAL) \
113 << __FILE__ << ":" << __LINE__ << ": " \ 112 << __FILE__ << ":" << __LINE__ << ": " \
114 << __FUNCTION__ << ": NOTREACHED() hit") 113 << __FUNCTION__ << ": NOTREACHED() hit")
115 114
116 #endif // TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_ 115 #endif // TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_
OLDNEW
« no previous file with comments | « tools/relocation_packer/relocation_packer.gyp ('k') | tools/relocation_packer/src/debug_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698