| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <cassert> | 10 #include <cassert> |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 std::string* message_; | 441 std::string* message_; |
| 442 }; | 442 }; |
| 443 | 443 |
| 444 // CHECK dies with a fatal error if condition is not true. It is *not* | 444 // CHECK dies with a fatal error if condition is not true. It is *not* |
| 445 // controlled by NDEBUG, so the check will be executed regardless of | 445 // controlled by NDEBUG, so the check will be executed regardless of |
| 446 // compilation mode. | 446 // compilation mode. |
| 447 // | 447 // |
| 448 // We make sure CHECK et al. always evaluates their arguments, as | 448 // We make sure CHECK et al. always evaluates their arguments, as |
| 449 // doing CHECK(FunctionWithSideEffect()) is a common idiom. | 449 // doing CHECK(FunctionWithSideEffect()) is a common idiom. |
| 450 | 450 |
| 451 #if defined(OFFICIAL_BUILD) && defined(NDEBUG) && !defined(OS_ANDROID) | 451 #if defined(OFFICIAL_BUILD) && defined(NDEBUG) |
| 452 | 452 |
| 453 // Make all CHECK functions discard their log strings to reduce code | 453 // Make all CHECK functions discard their log strings to reduce code |
| 454 // bloat for official release builds (except Android). | 454 // bloat for official release builds (except Android). |
| 455 | 455 |
| 456 // TODO(akalin): This would be more valuable if there were some way to | 456 // TODO(akalin): This would be more valuable if there were some way to |
| 457 // remove BreakDebugger() from the backtrace, perhaps by turning it | 457 // remove BreakDebugger() from the backtrace, perhaps by turning it |
| 458 // into a macro (like __debugbreak() on Windows). | 458 // into a macro (like __debugbreak() on Windows). |
| 459 #define CHECK(condition) \ | 459 #define CHECK(condition) \ |
| 460 !(condition) ? ::base::debug::BreakDebugger() : EAT_STREAM_PARAMETERS | 460 !(condition) ? ::base::debug::BreakDebugger() : EAT_STREAM_PARAMETERS |
| 461 | 461 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 #elif NOTIMPLEMENTED_POLICY == 5 | 992 #elif NOTIMPLEMENTED_POLICY == 5 |
| 993 #define NOTIMPLEMENTED() do {\ | 993 #define NOTIMPLEMENTED() do {\ |
| 994 static bool logged_once = false;\ | 994 static bool logged_once = false;\ |
| 995 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ | 995 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ |
| 996 logged_once = true;\ | 996 logged_once = true;\ |
| 997 } while(0);\ | 997 } while(0);\ |
| 998 EAT_STREAM_PARAMETERS | 998 EAT_STREAM_PARAMETERS |
| 999 #endif | 999 #endif |
| 1000 | 1000 |
| 1001 #endif // BASE_LOGGING_H_ | 1001 #endif // BASE_LOGGING_H_ |
| OLD | NEW |