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 #include "chrome/test/chromedriver/logging.h" | 5 #include "chrome/test/chromedriver/logging.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 g_log_level = Log::kAll; | 228 g_log_level = Log::kAll; |
229 | 229 |
230 // Turn on VLOG for chromedriver. This is parsed during logging::InitLogging. | 230 // Turn on VLOG for chromedriver. This is parsed during logging::InitLogging. |
231 cmd_line->AppendSwitchASCII("vmodule", "*/chrome/test/chromedriver/*=3"); | 231 cmd_line->AppendSwitchASCII("vmodule", "*/chrome/test/chromedriver/*=3"); |
232 | 232 |
233 logging::SetMinLogLevel(logging::LOG_WARNING); | 233 logging::SetMinLogLevel(logging::LOG_WARNING); |
234 logging::SetLogItems(false, // enable_process_id | 234 logging::SetLogItems(false, // enable_process_id |
235 false, // enable_thread_id | 235 false, // enable_thread_id |
236 false, // enable_timestamp | 236 false, // enable_timestamp |
237 false); // enable_tickcount | 237 false); // enable_tickcount |
238 logging::SetLogMessageHandler(&HandleLogMessage); | 238 logging::PushLogMessageHandler(&HandleLogMessage); |
239 | 239 |
240 logging::LoggingSettings logging_settings; | 240 logging::LoggingSettings logging_settings; |
241 logging_settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 241 logging_settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
242 return logging::InitLogging(logging_settings); | 242 return logging::InitLogging(logging_settings); |
243 } | 243 } |
244 | 244 |
245 Status CreateLogs(const Capabilities& capabilities, | 245 Status CreateLogs(const Capabilities& capabilities, |
246 const Session* session, | 246 const Session* session, |
247 ScopedVector<WebDriverLog>* out_logs, | 247 ScopedVector<WebDriverLog>* out_logs, |
248 ScopedVector<DevToolsEventListener>* out_devtools_listeners, | 248 ScopedVector<DevToolsEventListener>* out_devtools_listeners, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 logs.push_back(browser_log); | 289 logs.push_back(browser_log); |
290 // If the level is OFF, don't even bother listening for DevTools events. | 290 // If the level is OFF, don't even bother listening for DevTools events. |
291 if (browser_log_level != Log::kOff) | 291 if (browser_log_level != Log::kOff) |
292 devtools_listeners.push_back(new ConsoleLogger(browser_log)); | 292 devtools_listeners.push_back(new ConsoleLogger(browser_log)); |
293 | 293 |
294 out_logs->swap(logs); | 294 out_logs->swap(logs); |
295 out_devtools_listeners->swap(devtools_listeners); | 295 out_devtools_listeners->swap(devtools_listeners); |
296 out_command_listeners->swap(command_listeners); | 296 out_command_listeners->swap(command_listeners); |
297 return Status(kOk); | 297 return Status(kOk); |
298 } | 298 } |
OLD | NEW |