OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <cassert> | 9 #include <cassert> |
10 #include <string> | 10 #include <string> |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 | 617 |
618 #if ENABLE_DCHECK | 618 #if ENABLE_DCHECK |
619 | 619 |
620 #if defined(NDEBUG) | 620 #if defined(NDEBUG) |
621 | 621 |
622 #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ | 622 #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ |
623 COMPACT_GOOGLE_LOG_EX_ERROR_REPORT(ClassName , ##__VA_ARGS__) | 623 COMPACT_GOOGLE_LOG_EX_ERROR_REPORT(ClassName , ##__VA_ARGS__) |
624 #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_ERROR_REPORT | 624 #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_ERROR_REPORT |
625 const LogSeverity LOG_DCHECK = LOG_ERROR_REPORT; | 625 const LogSeverity LOG_DCHECK = LOG_ERROR_REPORT; |
626 BASE_EXPORT extern DcheckState g_dcheck_state; | 626 BASE_EXPORT extern DcheckState g_dcheck_state; |
| 627 |
| 628 #if defined(DCHECK_ALWAYS_ON) |
| 629 #define DCHECK_IS_ON() true |
| 630 #else |
627 #define DCHECK_IS_ON() \ | 631 #define DCHECK_IS_ON() \ |
628 ((::logging::g_dcheck_state == \ | 632 ((::logging::g_dcheck_state == \ |
629 ::logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS) && \ | 633 ::logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS) && \ |
630 LOG_IS_ON(DCHECK)) | 634 LOG_IS_ON(DCHECK)) |
| 635 #endif // defined(DCHECK_ALWAYS_ON) |
631 | 636 |
632 #else // defined(NDEBUG) | 637 #else // defined(NDEBUG) |
633 | 638 |
634 // On a regular debug build, we want to have DCHECKs enabled. | 639 // On a regular debug build, we want to have DCHECKs enabled. |
635 #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ | 640 #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ |
636 COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__) | 641 COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__) |
637 #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL | 642 #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL |
638 const LogSeverity LOG_DCHECK = LOG_FATAL; | 643 const LogSeverity LOG_DCHECK = LOG_FATAL; |
639 #define DCHECK_IS_ON() true | 644 #define DCHECK_IS_ON() true |
640 | 645 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 namespace base { | 948 namespace base { |
944 | 949 |
945 class StringPiece; | 950 class StringPiece; |
946 | 951 |
947 // Allows StringPiece to be logged. | 952 // Allows StringPiece to be logged. |
948 BASE_EXPORT std::ostream& operator<<(std::ostream& o, const StringPiece& piece); | 953 BASE_EXPORT std::ostream& operator<<(std::ostream& o, const StringPiece& piece); |
949 | 954 |
950 } // namespace base | 955 } // namespace base |
951 | 956 |
952 #endif // BASE_LOGGING_H_ | 957 #endif // BASE_LOGGING_H_ |
OLD | NEW |