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

Side by Side Diff: third_party/android_platform/bionic/tools/relocation_packer/src/debug.h

Issue 1959513002: Revert of Fix invalid using decl in bionic relocation_packer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « third_party/android_platform/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 // Logging streams. Not thread-safe. 75 // Logging streams. Not thread-safe.
76 static std::ostream* info_stream_; 76 static std::ostream* info_stream_;
77 static std::ostream* error_stream_; 77 static std::ostream* error_stream_;
78 }; 78 };
79 79
80 } // namespace relocation_packer 80 } // namespace relocation_packer
81 81
82 // Make logging severities visible globally. 82 // Make logging severities visible globally.
83 typedef relocation_packer::Logger::Severity LogSeverity; 83 typedef relocation_packer::Logger::Severity LogSeverity;
84 using LogSeverity::INFO;
85 using LogSeverity::WARNING;
86 using LogSeverity::ERROR;
87 using LogSeverity::FATAL;
84 88
85 // LOG(severity) prints a message with the given severity, and aborts if 89 // LOG(severity) prints a message with the given severity, and aborts if
86 // severity is FATAL. LOG_IF(severity, predicate) does the same but only if 90 // severity is FATAL. LOG_IF(severity, predicate) does the same but only if
87 // predicate is true. INT_MIN is guaranteed to be less than or equal to 91 // predicate is true. INT_MIN is guaranteed to be less than or equal to
88 // any verbosity level. 92 // any verbosity level.
89 #define LOG(severity) \ 93 #define LOG(severity) \
90 (relocation_packer::Logger(Logger::severity, INT_MIN, true).GetStream()) 94 (relocation_packer::Logger(severity, INT_MIN, true).GetStream())
91 #define LOG_IF(severity, predicate) \ 95 #define LOG_IF(severity, predicate) \
92 (relocation_packer::Logger(Logger::severity, INT_MIN, (predicate)) \ 96 (relocation_packer::Logger(severity, INT_MIN, (predicate)).GetStream())
93 .GetStream())
94 97
95 // VLOG(level) prints its message as INFO if level is less than or equal to 98 // VLOG(level) prints its message as INFO if level is less than or equal to
96 // the current verbosity level. 99 // the current verbosity level.
97 #define VLOG(level) \ 100 #define VLOG(level) \
98 (relocation_packer::Logger(Logger::INFO, (level), true).GetStream()) 101 (relocation_packer::Logger(INFO, (level), true).GetStream())
99 #define VLOG_IF(level, predicate) \ 102 #define VLOG_IF(level, predicate) \
100 (relocation_packer::Logger(Logger::INFO, (level), (predicate)).GetStream()) 103 (relocation_packer::Logger(INFO, (level), (predicate)).GetStream())
101 104
102 // CHECK(predicate) fails with a FATAL log message if predicate is false. 105 // CHECK(predicate) fails with a FATAL log message if predicate is false.
103 #define CHECK(predicate) (LOG_IF(FATAL, !(predicate)) \ 106 #define CHECK(predicate) (LOG_IF(FATAL, !(predicate)) \
104 << __FILE__ << ":" << __LINE__ << ": " \ 107 << __FILE__ << ":" << __LINE__ << ": " \
105 << __FUNCTION__ << ": CHECK '" #predicate "' failed") 108 << __FUNCTION__ << ": CHECK '" #predicate "' failed")
106 109
107 // NOTREACHED() always fails with a FATAL log message. 110 // NOTREACHED() always fails with a FATAL log message.
108 #define NOTREACHED(_) (LOG(FATAL) \ 111 #define NOTREACHED(_) (LOG(FATAL) \
109 << __FILE__ << ":" << __LINE__ << ": " \ 112 << __FILE__ << ":" << __LINE__ << ": " \
110 << __FUNCTION__ << ": NOTREACHED() hit") 113 << __FUNCTION__ << ": NOTREACHED() hit")
111 114
112 #endif // TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_ 115 #endif // TOOLS_RELOCATION_PACKER_SRC_DEBUG_H_
OLDNEW
« no previous file with comments | « third_party/android_platform/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698