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 <cassert> | 8 #include <cassert> |
9 #include <string> | 9 #include <string> |
10 #include <cstring> | 10 #include <cstring> |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 | 885 |
886 #define RAW_LOG(level, message) logging::RawLog(logging::LOG_ ## level, message) | 886 #define RAW_LOG(level, message) logging::RawLog(logging::LOG_ ## level, message) |
887 | 887 |
888 #define RAW_CHECK(condition) \ | 888 #define RAW_CHECK(condition) \ |
889 do { \ | 889 do { \ |
890 if (!(condition)) \ | 890 if (!(condition)) \ |
891 logging::RawLog(logging::LOG_FATAL, "Check failed: " #condition "\n"); \ | 891 logging::RawLog(logging::LOG_FATAL, "Check failed: " #condition "\n"); \ |
892 } while (0) | 892 } while (0) |
893 | 893 |
894 #if defined(OS_WIN) | 894 #if defined(OS_WIN) |
| 895 // Returns true if logging to file is enabled. |
| 896 BASE_EXPORT bool IsLoggingToFileEnabled(); |
| 897 |
895 // Returns the default log file path. | 898 // Returns the default log file path. |
896 BASE_EXPORT std::wstring GetLogFileFullPath(); | 899 BASE_EXPORT std::wstring GetLogFileFullPath(); |
897 #endif | 900 #endif |
898 | 901 |
899 } // namespace logging | 902 } // namespace logging |
900 | 903 |
901 // Note that "The behavior of a C++ program is undefined if it adds declarations | 904 // Note that "The behavior of a C++ program is undefined if it adds declarations |
902 // or definitions to namespace std or to a namespace within namespace std unless | 905 // or definitions to namespace std or to a namespace within namespace std unless |
903 // otherwise specified." --C++11[namespace.std] | 906 // otherwise specified." --C++11[namespace.std] |
904 // | 907 // |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 #elif NOTIMPLEMENTED_POLICY == 5 | 964 #elif NOTIMPLEMENTED_POLICY == 5 |
962 #define NOTIMPLEMENTED() do {\ | 965 #define NOTIMPLEMENTED() do {\ |
963 static bool logged_once = false;\ | 966 static bool logged_once = false;\ |
964 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ | 967 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ |
965 logged_once = true;\ | 968 logged_once = true;\ |
966 } while(0);\ | 969 } while(0);\ |
967 EAT_STREAM_PARAMETERS | 970 EAT_STREAM_PARAMETERS |
968 #endif | 971 #endif |
969 | 972 |
970 #endif // BASE_LOGGING_H_ | 973 #endif // BASE_LOGGING_H_ |
OLD | NEW |