| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 // Sets the Log Message Handler that gets passed every log message before | 282 // Sets the Log Message Handler that gets passed every log message before |
| 283 // it's sent to other log destinations (if any). | 283 // it's sent to other log destinations (if any). |
| 284 // Returns true to signal that it handled the message and the message | 284 // Returns true to signal that it handled the message and the message |
| 285 // should not be sent to other log destinations. | 285 // should not be sent to other log destinations. |
| 286 typedef bool (*LogMessageHandlerFunction)(int severity, | 286 typedef bool (*LogMessageHandlerFunction)(int severity, |
| 287 const char* file, int line, size_t message_start, const std::string& str); | 287 const char* file, int line, size_t message_start, const std::string& str); |
| 288 BASE_EXPORT void SetLogMessageHandler(LogMessageHandlerFunction handler); | 288 BASE_EXPORT void SetLogMessageHandler(LogMessageHandlerFunction handler); |
| 289 BASE_EXPORT LogMessageHandlerFunction GetLogMessageHandler(); | 289 BASE_EXPORT LogMessageHandlerFunction GetLogMessageHandler(); |
| 290 | 290 |
| 291 // Sets the Crash Message Handler that gets passed a fatal log message before |
| 292 // the process crashes. |
| 293 typedef void (*CrashMessageHandlerFunction)(const std::string& message); |
| 294 BASE_EXPORT void SetCrashMessageHandler(CrashMessageHandlerFunction handler); |
| 295 |
| 291 typedef int LogSeverity; | 296 typedef int LogSeverity; |
| 292 const LogSeverity LOG_VERBOSE = -1; // This is level 1 verbosity | 297 const LogSeverity LOG_VERBOSE = -1; // This is level 1 verbosity |
| 293 // Note: the log severities are used to index into the array of names, | 298 // Note: the log severities are used to index into the array of names, |
| 294 // see log_severity_names. | 299 // see log_severity_names. |
| 295 const LogSeverity LOG_INFO = 0; | 300 const LogSeverity LOG_INFO = 0; |
| 296 const LogSeverity LOG_WARNING = 1; | 301 const LogSeverity LOG_WARNING = 1; |
| 297 const LogSeverity LOG_ERROR = 2; | 302 const LogSeverity LOG_ERROR = 2; |
| 298 const LogSeverity LOG_FATAL = 3; | 303 const LogSeverity LOG_FATAL = 3; |
| 299 const LogSeverity LOG_NUM_SEVERITIES = 4; | 304 const LogSeverity LOG_NUM_SEVERITIES = 4; |
| 300 | 305 |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 #elif NOTIMPLEMENTED_POLICY == 5 | 993 #elif NOTIMPLEMENTED_POLICY == 5 |
| 989 #define NOTIMPLEMENTED() do {\ | 994 #define NOTIMPLEMENTED() do {\ |
| 990 static bool logged_once = false;\ | 995 static bool logged_once = false;\ |
| 991 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ | 996 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ |
| 992 logged_once = true;\ | 997 logged_once = true;\ |
| 993 } while(0);\ | 998 } while(0);\ |
| 994 EAT_STREAM_PARAMETERS | 999 EAT_STREAM_PARAMETERS |
| 995 #endif | 1000 #endif |
| 996 | 1001 |
| 997 #endif // BASE_LOGGING_H_ | 1002 #endif // BASE_LOGGING_H_ |
| OLD | NEW |