Merge pull request #31073 from oddui/fixes/selenium-webdriver-logging

Fix selenium-webdriver logging type
This commit is contained in:
Jesse Trinity
2018-12-12 18:36:48 -08:00
committed by GitHub
2 changed files with 37 additions and 2 deletions
+31 -2
View File
@@ -4,7 +4,8 @@
// Yuki Kokubun <https://github.com/Kuniwak>,
// Craig Nishina <https://github.com/cnishina>,
// Simon Gellis <https://github.com/SupernaviX>,
// Ben Dixon <https://github.com/bendxn>
// Ben Dixon <https://github.com/bendxn>,
// Ziyu <https://github.com/oddui>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -540,7 +541,7 @@ export namespace logging {
* @param {string} name the logger's name.
* @return {!Logger} the requested logger.
*/
getLogger(name: string): Logger;
getLogger(name?: string): Logger;
/**
* Creates a new logger.
@@ -552,6 +553,34 @@ export namespace logging {
*/
createLogger_(name: string, parent: Logger): Logger;
}
/**
* Retrieves a named logger, creating it in the process. This function will
* implicitly create the requested logger, and any of its parents, if they
* do not yet exist.
*
* @param {string} name the logger's name.
* @return {!Logger} the requested logger.
*/
function getLogger(name?: string): Logger;
/**
* Adds the console handler to the given logger. The console handler will log
* all messages using the JavaScript Console API.
*
* @param {Logger=} opt_logger The logger to add the handler to; defaults
* to the root logger.
*/
function addConsoleHandler(opt_logger?: Logger): void;
/**
* Removes the console log handler from the given logger.
*
* @param {Logger=} opt_logger The logger to remove the handler from; defaults
* to the root logger.
* @see exports.addConsoleHandler
*/
function removeConsoleHandler(opt_logger?: Logger): void;
}
export namespace promise {
+6
View File
@@ -758,6 +758,12 @@ function TestLogging() {
type = webdriver.logging.Type.DRIVER;
type = webdriver.logging.Type.PERFORMANCE;
type = webdriver.logging.Type.SERVER;
let logger: webdriver.logging.Logger = webdriver.logging.getLogger();
webdriver.logging.addConsoleHandler();
webdriver.logging.addConsoleHandler(logger);
webdriver.logging.removeConsoleHandler();
webdriver.logging.removeConsoleHandler(logger);
}
function TestLoggingEntry() {