| 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 IPC_IPC_LOGGING_H_ | 5 #ifndef IPC_IPC_LOGGING_H_ |
| 6 #define IPC_IPC_LOGGING_H_ | 6 #define IPC_IPC_LOGGING_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 10 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 ANSI_COLOR_GREEN, | 94 ANSI_COLOR_GREEN, |
| 95 ANSI_COLOR_YELLOW, | 95 ANSI_COLOR_YELLOW, |
| 96 ANSI_COLOR_BLUE, | 96 ANSI_COLOR_BLUE, |
| 97 ANSI_COLOR_MAGENTA, | 97 ANSI_COLOR_MAGENTA, |
| 98 ANSI_COLOR_CYAN, | 98 ANSI_COLOR_CYAN, |
| 99 ANSI_COLOR_WHITE | 99 ANSI_COLOR_WHITE |
| 100 } ANSIColor; | 100 } ANSIColor; |
| 101 const char* ANSIEscape(ANSIColor color); | 101 const char* ANSIEscape(ANSIColor color); |
| 102 ANSIColor DelayColor(double delay); | 102 ANSIColor DelayColor(double delay); |
| 103 | 103 |
| 104 friend struct DefaultSingletonTraits<Logging>; | 104 friend struct base::DefaultSingletonTraits<Logging>; |
| 105 Logging(); | 105 Logging(); |
| 106 | 106 |
| 107 void OnSendLogs(); | 107 void OnSendLogs(); |
| 108 void Log(const LogData& data); | 108 void Log(const LogData& data); |
| 109 | 109 |
| 110 bool enabled_; | 110 bool enabled_; |
| 111 bool enabled_on_stderr_; // only used on POSIX for now | 111 bool enabled_on_stderr_; // only used on POSIX for now |
| 112 bool enabled_color_; // only used on POSIX for now | 112 bool enabled_color_; // only used on POSIX for now |
| 113 | 113 |
| 114 std::vector<LogData> queued_logs_; | 114 std::vector<LogData> queued_logs_; |
| 115 bool queue_invoke_later_pending_; | 115 bool queue_invoke_later_pending_; |
| 116 | 116 |
| 117 Sender* sender_; | 117 Sender* sender_; |
| 118 base::MessageLoop* main_thread_; | 118 base::MessageLoop* main_thread_; |
| 119 | 119 |
| 120 Consumer* consumer_; | 120 Consumer* consumer_; |
| 121 | 121 |
| 122 static LogFunctionMap* log_function_map_; | 122 static LogFunctionMap* log_function_map_; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace IPC | 125 } // namespace IPC |
| 126 | 126 |
| 127 #endif // IPC_MESSAGE_LOG_ENABLED | 127 #endif // IPC_MESSAGE_LOG_ENABLED |
| 128 | 128 |
| 129 #endif // IPC_IPC_LOGGING_H_ | 129 #endif // IPC_IPC_LOGGING_H_ |
| OLD | NEW |