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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 } | 635 } |
636 | 636 |
637 // We need overloads for enums that don't support operator<<. | 637 // We need overloads for enums that don't support operator<<. |
638 // (i.e. scoped enums where no operator<< overload was declared). | 638 // (i.e. scoped enums where no operator<< overload was declared). |
639 template <typename T> | 639 template <typename T> |
640 inline typename std::enable_if< | 640 inline typename std::enable_if< |
641 !base::internal::SupportsOstreamOperator<const T&>::value && | 641 !base::internal::SupportsOstreamOperator<const T&>::value && |
642 std::is_enum<T>::value, | 642 std::is_enum<T>::value, |
643 void>::type | 643 void>::type |
644 MakeCheckOpValueString(std::ostream* os, const T& v) { | 644 MakeCheckOpValueString(std::ostream* os, const T& v) { |
645 (*os) << static_cast<typename base::underlying_type<T>::type>(v); | 645 (*os) << static_cast<typename std::underlying_type<T>::type>(v); |
646 } | 646 } |
647 | 647 |
648 // We need an explicit overload for std::nullptr_t. | 648 // We need an explicit overload for std::nullptr_t. |
649 BASE_EXPORT void MakeCheckOpValueString(std::ostream* os, std::nullptr_t p); | 649 BASE_EXPORT void MakeCheckOpValueString(std::ostream* os, std::nullptr_t p); |
650 | 650 |
651 // Build the error message string. This is separate from the "Impl" | 651 // Build the error message string. This is separate from the "Impl" |
652 // function template because it is not performance critical and so can | 652 // function template because it is not performance critical and so can |
653 // be out of line, while the "Impl" code should be inline. Caller | 653 // be out of line, while the "Impl" code should be inline. Caller |
654 // takes ownership of the returned string. | 654 // takes ownership of the returned string. |
655 template<class t1, class t2> | 655 template<class t1, class t2> |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 #elif NOTIMPLEMENTED_POLICY == 5 | 1139 #elif NOTIMPLEMENTED_POLICY == 5 |
1140 #define NOTIMPLEMENTED() do {\ | 1140 #define NOTIMPLEMENTED() do {\ |
1141 static bool logged_once = false;\ | 1141 static bool logged_once = false;\ |
1142 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ | 1142 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ |
1143 logged_once = true;\ | 1143 logged_once = true;\ |
1144 } while(0);\ | 1144 } while(0);\ |
1145 EAT_STREAM_PARAMETERS | 1145 EAT_STREAM_PARAMETERS |
1146 #endif | 1146 #endif |
1147 | 1147 |
1148 #endif // BASE_LOGGING_H_ | 1148 #endif // BASE_LOGGING_H_ |
OLD | NEW |