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