| 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 <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 {"DEBUG", Log::kDebug}, | 57 {"DEBUG", Log::kDebug}, |
| 58 {"INFO", Log::kInfo}, | 58 {"INFO", Log::kInfo}, |
| 59 {"WARNING", Log::kWarning}, | 59 {"WARNING", Log::kWarning}, |
| 60 {"SEVERE", Log::kError}, | 60 {"SEVERE", Log::kError}, |
| 61 {"OFF", Log::kOff}, | 61 {"OFF", Log::kOff}, |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 Log::Level GetLevelFromSeverity(int severity) { | 64 Log::Level GetLevelFromSeverity(int severity) { |
| 65 switch (severity) { | 65 switch (severity) { |
| 66 case logging::LOG_FATAL: | 66 case logging::LOG_FATAL: |
| 67 case logging::LOG_ERROR_REPORT: | |
| 68 case logging::LOG_ERROR: | 67 case logging::LOG_ERROR: |
| 69 return Log::kError; | 68 return Log::kError; |
| 70 case logging::LOG_WARNING: | 69 case logging::LOG_WARNING: |
| 71 return Log::kWarning; | 70 return Log::kWarning; |
| 72 case logging::LOG_INFO: | 71 case logging::LOG_INFO: |
| 73 return Log::kInfo; | 72 return Log::kInfo; |
| 74 case logging::LOG_VERBOSE: | 73 case logging::LOG_VERBOSE: |
| 75 default: | 74 default: |
| 76 return Log::kDebug; | 75 return Log::kDebug; |
| 77 } | 76 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 new WebDriverLog(WebDriverLog::kBrowserType, browser_log_level); | 270 new WebDriverLog(WebDriverLog::kBrowserType, browser_log_level); |
| 272 logs.push_back(browser_log); | 271 logs.push_back(browser_log); |
| 273 // If the level is OFF, don't even bother listening for DevTools events. | 272 // If the level is OFF, don't even bother listening for DevTools events. |
| 274 if (browser_log_level != Log::kOff) | 273 if (browser_log_level != Log::kOff) |
| 275 listeners.push_back(new ConsoleLogger(browser_log)); | 274 listeners.push_back(new ConsoleLogger(browser_log)); |
| 276 | 275 |
| 277 out_logs->swap(logs); | 276 out_logs->swap(logs); |
| 278 out_listeners->swap(listeners); | 277 out_listeners->swap(listeners); |
| 279 return Status(kOk); | 278 return Status(kOk); |
| 280 } | 279 } |
| OLD | NEW |