| 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 CHROME_TEST_WEBDRIVER_WEBDRIVER_LOGGING_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_WEBDRIVER_LOGGING_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_LOGGING_H_ | 6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_LOGGING_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class Time; | 18 class Time; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace webdriver { | 21 namespace webdriver { |
| 22 | 22 |
| 23 // WebDriver logging levels. | 23 // WebDriver logging levels. |
| 24 enum LogLevel { | 24 enum LogLevel { |
| 25 kOffLogLevel = 1200, |
| 25 kSevereLogLevel = 1000, | 26 kSevereLogLevel = 1000, |
| 26 kWarningLogLevel = 900, | 27 kWarningLogLevel = 900, |
| 27 kInfoLogLevel = 800, | 28 kInfoLogLevel = 800, |
| 28 kFineLogLevel = 500, | 29 kFineLogLevel = 500, |
| 29 kFinerLogLevel = 400, | 30 kFinerLogLevel = 400, |
| 30 kAllLogLevel = -1000 | 31 kAllLogLevel = -1000 |
| 31 }; | 32 }; |
| 32 | 33 |
| 34 // |name| should be a webdriver log level, such as "INFO", "SEVERE", etc. |
| 35 LogLevel LogLevelFromString(const std::string& name); |
| 36 |
| 33 // Represents a type/source of a WebDriver log. | 37 // Represents a type/source of a WebDriver log. |
| 34 class LogType { | 38 class LogType { |
| 35 public: | 39 public: |
| 36 enum Type { | 40 enum Type { |
| 37 kInvalid = -1, | 41 kInvalid = -1, |
| 38 kDriver, | 42 kDriver, |
| 39 kNum // must be correct | 43 kNum // must be correct |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 static bool FromString(const std::string& name, LogType* log_type); | 46 static bool FromString(const std::string& name, LogType* log_type); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Initializes logging for WebDriver. All logging below the given level | 146 // Initializes logging for WebDriver. All logging below the given level |
| 143 // will be discarded in the global file log. The file log will use the given | 147 // will be discarded in the global file log. The file log will use the given |
| 144 // log path. If the specified log path is empty, the log will write to | 148 // log path. If the specified log path is empty, the log will write to |
| 145 // 'chromedriver.log' in the current working directory, if writeable, or the | 149 // 'chromedriver.log' in the current working directory, if writeable, or the |
| 146 // system temp directory. Returns true on success. | 150 // system temp directory. Returns true on success. |
| 147 bool InitWebDriverLogging(const FilePath& log_path, LogLevel min_log_level); | 151 bool InitWebDriverLogging(const FilePath& log_path, LogLevel min_log_level); |
| 148 | 152 |
| 149 } // namespace webdriver | 153 } // namespace webdriver |
| 150 | 154 |
| 151 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_LOGGING_H_ | 155 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_LOGGING_H_ |
| OLD | NEW |