OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef BASE_LOGGING_H_ | 5 #ifndef BASE_LOGGING_H_ |
6 #define BASE_LOGGING_H_ | 6 #define BASE_LOGGING_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { | 252 std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { |
253 std::ostringstream ss; | 253 std::ostringstream ss; |
254 ss << names << " (" << v1 << " vs. " << v2 << ")"; | 254 ss << names << " (" << v1 << " vs. " << v2 << ")"; |
255 std::string* msg = new std::string(ss.str()); | 255 std::string* msg = new std::string(ss.str()); |
256 return msg; | 256 return msg; |
257 } | 257 } |
258 | 258 |
259 extern std::string* MakeCheckOpStringIntInt(int v1, int v2, const char* names); | 259 extern std::string* MakeCheckOpStringIntInt(int v1, int v2, const char* names); |
260 | 260 |
261 template<int, int> | 261 template<int, int> |
262 std::string* MakeCheckOpString(const int& v1, const int& v2, const char* names)
{ | 262 std::string* MakeCheckOpString(const int& v1, |
| 263 const int& v2, |
| 264 const char* names) { |
263 return MakeCheckOpStringIntInt(v1, v2, names); | 265 return MakeCheckOpStringIntInt(v1, v2, names); |
264 } | 266 } |
265 | 267 |
266 // Plus some debug-logging macros that get compiled to nothing for production | 268 // Plus some debug-logging macros that get compiled to nothing for production |
267 // | 269 // |
268 // DEBUG_MODE is for uses like | 270 // DEBUG_MODE is for uses like |
269 // if (DEBUG_MODE) foo.CheckThatFoo(); | 271 // if (DEBUG_MODE) foo.CheckThatFoo(); |
270 // instead of | 272 // instead of |
271 // #ifndef NDEBUG | 273 // #ifndef NDEBUG |
272 // foo.CheckThatFoo(); | 274 // foo.CheckThatFoo(); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 #elif NOTIMPLEMENTED_POLICY == 4 | 617 #elif NOTIMPLEMENTED_POLICY == 4 |
616 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG | 618 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG |
617 #elif NOTIMPLEMENTED_POLICY == 5 | 619 #elif NOTIMPLEMENTED_POLICY == 5 |
618 #define NOTIMPLEMENTED() do {\ | 620 #define NOTIMPLEMENTED() do {\ |
619 static int count = 0;\ | 621 static int count = 0;\ |
620 LOG_IF(ERROR, 0 == count++) << NOTIMPLEMENTED_MSG;\ | 622 LOG_IF(ERROR, 0 == count++) << NOTIMPLEMENTED_MSG;\ |
621 } while(0) | 623 } while(0) |
622 #endif | 624 #endif |
623 | 625 |
624 #endif // BASE_LOGGING_H_ | 626 #endif // BASE_LOGGING_H_ |
OLD | NEW |